MCPcopy
hub / github.com/django/django / write

Method write

django/utils/feedgenerator.py:298–309  ·  view source on GitHub ↗
(self, outfile, encoding)

Source from the content-addressed store, hash-verified

296 content_type = "application/rss+xml; charset=utf-8"
297
298 def write(self, outfile, encoding):
299 handler = SimplerXMLGenerator(outfile, encoding, short_empty_elements=True)
300 handler.startDocument()
301 # Any stylesheet must come after the start of the document but before
302 # any tag. https://www.w3.org/Style/styling-XML.en.html
303 self.add_stylesheets(handler)
304 handler.startElement("rss", self.rss_attributes())
305 handler.startElement("channel", self.root_attributes())
306 self.add_root_elements(handler)
307 self.write_items(handler)
308 self.endChannelElement(handler)
309 handler.endElement("rss")
310
311 def rss_attributes(self):
312 return {

Callers 4

compress_sequenceFunction · 0.45
acompress_sequenceFunction · 0.45
extractMethod · 0.45
templatizeFunction · 0.45

Calls 8

add_stylesheetsMethod · 0.95
startElementMethod · 0.95
rss_attributesMethod · 0.95
add_root_elementsMethod · 0.95
write_itemsMethod · 0.95
endChannelElementMethod · 0.95
SimplerXMLGeneratorClass · 0.90
root_attributesMethod · 0.45

Tested by

no test coverage detected