From 45fc16343448c79b787104a81197e8a2b52ae4f6 Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 31 Aug 2014 12:56:18 -0700 Subject: [PATCH] PEP8 changes for rss feed cache code --- sickbeard/rssfeeds.py | 20 ++++++++++---------- sickbeard/tvcache.py | 2 -- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sickbeard/rssfeeds.py b/sickbeard/rssfeeds.py index 9c59f9d9..6bbc975c 100644 --- a/sickbeard/rssfeeds.py +++ b/sickbeard/rssfeeds.py @@ -40,17 +40,17 @@ class RSSFeeds: fc = cache.Cache(fs) feed = fc.fetch(url, False, False, request_headers) - if not feed or not feed.entries: - logger.log(u"RSS error loading url: " + url, logger.DEBUG) - return - elif 'error' in feed.feed: - err_code = feed.feed['error']['code'] - err_desc = feed.feed['error']['description'] + if feed: + if 'entries' in feed: + return feed + elif 'error' in feed.feed: + err_code = feed.feed['error']['code'] + err_desc = feed.feed['error']['description'] - logger.log( - u"RSS ERROR:[%s] CODE:[%s]" % (err_desc, err_code), logger.DEBUG) - return + logger.log( + u"RSS ERROR:[%s] CODE:[%s]" % (err_desc, err_code), logger.DEBUG) else: - return feed + logger.log(u"RSS error loading url: " + url, logger.DEBUG) + except Exception as e: logger.log(u"RSS error: " + ex(e), logger.DEBUG) \ No newline at end of file diff --git a/sickbeard/tvcache.py b/sickbeard/tvcache.py index ac554f72..1dd52d49 100644 --- a/sickbeard/tvcache.py +++ b/sickbeard/tvcache.py @@ -220,8 +220,6 @@ class TVCache(): def shouldClearCache(self): # if daily search hasn't used our previous results yet then don't clear the cache if self.lastUpdate > self.lastSearch: - logger.log( - u"Daily search has not yet used our last cache results, not clearing cache ...", logger.DEBUG) return False return True