1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-16 06:15:09 -05:00

PEP8 changes for rss feed cache code

This commit is contained in:
echel0n 2014-08-31 12:56:18 -07:00
parent 571e7c7d61
commit 45fc163434
2 changed files with 10 additions and 12 deletions

View File

@ -40,17 +40,17 @@ class RSSFeeds:
fc = cache.Cache(fs) fc = cache.Cache(fs)
feed = fc.fetch(url, False, False, request_headers) feed = fc.fetch(url, False, False, request_headers)
if not feed or not feed.entries: if feed:
logger.log(u"RSS error loading url: " + url, logger.DEBUG) if 'entries' in feed:
return return feed
elif 'error' in feed.feed: elif 'error' in feed.feed:
err_code = feed.feed['error']['code'] err_code = feed.feed['error']['code']
err_desc = feed.feed['error']['description'] err_desc = feed.feed['error']['description']
logger.log( logger.log(
u"RSS ERROR:[%s] CODE:[%s]" % (err_desc, err_code), logger.DEBUG) u"RSS ERROR:[%s] CODE:[%s]" % (err_desc, err_code), logger.DEBUG)
return
else: else:
return feed logger.log(u"RSS error loading url: " + url, logger.DEBUG)
except Exception as e: except Exception as e:
logger.log(u"RSS error: " + ex(e), logger.DEBUG) logger.log(u"RSS error: " + ex(e), logger.DEBUG)

View File

@ -220,8 +220,6 @@ class TVCache():
def shouldClearCache(self): def shouldClearCache(self):
# if daily search hasn't used our previous results yet then don't clear the cache # if daily search hasn't used our previous results yet then don't clear the cache
if self.lastUpdate > self.lastSearch: 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 False
return True return True