Commits  committed b3cfd71 Merge

Merge feedgenerator patch.

  • Participants
  • Parent commits e28c929, 7208d5b
  • Branches trunk

Comments (0)

Files changed (2)

   - ``uk_counties`` returns tuples rather than lists.
 * 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/

     """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: