feed: Give defaults for _get_entry_name formatting data
authorW. Trevor King <wking@tremily.us>
Sat, 14 Sep 2013 16:49:56 +0000 (09:49 -0700)
committerW. Trevor King <wking@tremily.us>
Sat, 14 Sep 2013 16:56:28 +0000 (09:56 -0700)
We don't want to crash if the source feed is missing some data that
the user expects, or if the user just hasn't had the time to adjust
the name-format config.

Signed-off-by: W. Trevor King <wking@tremily.us>
rss2email/feed.py

index 3835a45a5fc79befd31fcb83678d607a16962b7a..876b9c39039174f8d309f2d041d8e49af45e41c3 100644 (file)
@@ -552,7 +552,12 @@ class Feed (object):
         """
         if not self.name_format:
             return ''
-        data = {'feed': self}
+        data = {
+            'feed': self,
+            'feed-title': '<feed title>',
+            'author': '<author>',
+            'publisher': '<publisher>',
+            }
         feed = parsed.feed
         data['feed-title'] = feed.get('title', '')
         for x in [entry, feed]: