From c9f568142a076ab4f0af65411c0770775ab833c1 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 15 Mar 2013 07:44:02 -0400 Subject: [PATCH] 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 --- rss2email/feed.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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) -- 2.26.2