From: W. Trevor King Date: Fri, 15 Mar 2013 11:44:02 +0000 (-0400) Subject: feed: Streamline rel-via title extraction in _process_entry_content() X-Git-Tag: v3.3~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c9f568142a076ab4f0af65411c0770775ab833c1;p=rss2email.git feed: Streamline rel-via title extraction in _process_entry_content() No functional change here, this just tightens up the Python code for clarity. Signed-off-by: W. Trevor King --- diff --git a/rss2email/feed.py b/rss2email/feed.py index 68a79f4..a86be3e 100644 --- a/rss2email/feed.py +++ b/rss2email/feed.py @@ -710,9 +710,7 @@ class Feed (object): for elink in getattr(entry, 'links', []): if elink.get('rel', None) == 'via': url = elink['href'] - title = url - if elink.get('title', None): - title = elink['title'] + title = elink.get('title', url) lines.append('

Via {}

'.format( url, title)) lines.extend([ @@ -739,9 +737,7 @@ class Feed (object): for elink in getattr(entry, 'links', []): if elink.get('rel', None) == 'via': url = elink['href'] - title = url - if elink.get('title', None): - title = elink['title'] + title = elink.get('title', url) lines.append('Via: {} {}'.format(title, url)) content['type'] = 'text/plain' content['value'] = '\n'.join(lines)