1. storborg
  2. WebHelpers


Mike Orr  committed 7208d5b

Add 'generator' and 'source' properties to RSS2 feeds. Patch by Vince Spicer.

  • Participants
  • Parent commits 954dcf9
  • Branches trunk

Comments (0)

Files changed (2)


View file
  • Ignore whitespace
 1.0b1 (tip)
 * webhelpers.feedgenerator:
   - ``rfc3339_date`` now accepts date objects without crashing.
+  - Add 'generator' and 'source' properties to RSS2 feeds. Patch by
+    Vince Spicer.
 * webhelpers.html.converters:
   - New helper ``render()`` formats HTML to text.
   - New helper ``sanitize()`` strips HTML tags from user input.

File webhelpers/feedgenerator.py

View file
  • Ignore whitespace
     """Base class for all syndication feeds. Subclasses should provide write()"""
     def __init__(self, title, link, description, language=None, author_email=None,
             author_name=None, author_link=None, subtitle=None, categories=None,
-            feed_url=None, feed_copyright=None, feed_guid=None, ttl=None):
+            feed_url=None, feed_copyright=None, feed_guid=None, ttl=None, 
+            generator=None, source=None):
         self.feed = {
             'title': title,
             'link': link,
             'feed_copyright': feed_copyright,
             'id': feed_guid or link,
             'ttl': ttl,
+            'generator': generator,
+            'source': source,
         self.items = []
                 handler.addQuickElement(u"guid", item['unique_id'])
             if item['ttl'] is not None:
                 handler.addQuickElement(u"ttl", item['ttl'])
+            if item['generator'] is not None:
+                handler.addQuickElement(u"generator", item['generator'])
+            if item['source'] is not None:
+                handler.addQuickElement(u"source", item['source'])
             # Enclosure.
             if item['enclosure'] is not None: