From: W. Trevor King Date: Sat, 14 Sep 2013 16:49:56 +0000 (-0700) Subject: feed: Give defaults for _get_entry_name formatting data X-Git-Tag: v3.7~7^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1ae05a019f26cbac0a1dcc737249e44f04e224fb;p=rss2email.git feed: Give defaults for _get_entry_name formatting data 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 --- diff --git a/rss2email/feed.py b/rss2email/feed.py index 3835a45..876b9c3 100644 --- a/rss2email/feed.py +++ b/rss2email/feed.py @@ -552,7 +552,12 @@ class Feed (object): """ if not self.name_format: return '' - data = {'feed': self} + data = { + 'feed': self, + 'feed-title': '', + 'author': '', + 'publisher': '', + } feed = parsed.feed data['feed-title'] = feed.get('title', '') for x in [entry, feed]: