Ticket #502: feedgenerator.patch
File feedgenerator.patch, 1.4 KB (added by , 19 years ago) |
---|
-
feedgenerator.py
33 33 34 34 def add_item(self, title, link, description, author_email=None, 35 35 author_name=None, pubdate=None, comments=None, unique_id=None, 36 enclosure=None ):36 enclosure=None, category=None): 37 37 """ 38 38 Adds an item to the feed. All args are expected to be Python Unicode 39 39 objects except pubdate, which is a datetime.datetime object, and … … 49 49 'comments': comments, 50 50 'unique_id': unique_id, 51 51 'enclosure': enclosure, 52 'category': category, 52 53 }) 53 54 54 55 def num_items(self): … … 142 143 handler.addQuickElement(u"enclosure", '', 143 144 {u"url": item['enclosure'].url, u"length": item['enclosure'].length, 144 145 u"type": item['enclosure'].mime_type}) 146 if item['category'] is not None: 147 if isinstance(item['category'], list): 148 for cat in item['category']: 149 handler.addQuickElement(u"category", cat, {}) 150 else: 151 handler.addQuickElement(u"category", item['category'], {}) 145 152 handler.endElement(u"item") 146 153 147 154 # This isolates the decision of what the system default is, so calling code can