diff --git a/couchpotato/core/logger.py b/couchpotato/core/logger.py index f9afcb6..68a6c3f 100644 --- a/couchpotato/core/logger.py +++ b/couchpotato/core/logger.py @@ -1,6 +1,5 @@ import logging import re -import traceback class CPLog(object): diff --git a/couchpotato/core/plugins/scanner/main.py b/couchpotato/core/plugins/scanner/main.py index 37de486..56e5715 100644 --- a/couchpotato/core/plugins/scanner/main.py +++ b/couchpotato/core/plugins/scanner/main.py @@ -336,7 +336,7 @@ class Scanner(Plugin): break if return_ignored is False and identifier in ignored_identifiers: - log.debug('Ignore file found, ignoring release: %s' % identifier) + log.debug('Ignore file found, ignoring release: %s', identifier) continue # Group extra (and easy) files first diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index dba0ea7..23e8ea5 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -392,7 +392,7 @@ class Searcher(Plugin): req_match += len(list(set(nzb_words) & set(req))) == len(req) if self.conf('required_words') and req_match == 0: - log.info2("Wrong: Required word missing: %s" % nzb['name']) + log.info2('Wrong: Required word missing: %s', nzb['name']) return False # Ignore releases @@ -403,7 +403,7 @@ class Searcher(Plugin): ignored_match += len(list(set(nzb_words) & set(ignored))) == len(ignored) if self.conf('ignored_words') and ignored_match: - log.info2("Wrong: '%s' contains 'ignored words'" % (nzb['name'])) + log.info2("Wrong: '%s' contains 'ignored words'", (nzb['name'])) return False # Ignore porn stuff @@ -462,7 +462,7 @@ class Searcher(Plugin): if len(movie_words) <= 2 and self.correctYear([nzb['name']], movie['library']['year'], 0): return True - log.info("Wrong: %s, undetermined naming. Looking for '%s (%s)'" % (nzb['name'], movie_name, movie['library']['year'])) + log.info("Wrong: %s, undetermined naming. Looking for '%s (%s)'", (nzb['name'], movie_name, movie['library']['year'])) return False def containsOtherQuality(self, nzb, movie_year = None, preferred_quality = {}): diff --git a/couchpotato/core/providers/automation/base.py b/couchpotato/core/providers/automation/base.py index e33a44e..4655c1a 100644 --- a/couchpotato/core/providers/automation/base.py +++ b/couchpotato/core/providers/automation/base.py @@ -74,13 +74,13 @@ class Automation(Provider): req_match += len(list(set(movie_genres) & set(req))) == len(req) if self.getMinimal('required_genres') and req_match == 0: - log.info2("Required genre(s) missing for %s" % movie['original_title']) + log.info2('Required genre(s) missing for %s', movie['original_title']) return False for ign_set in ignored_genres: ign = splitString(ign_set, '&') if len(list(set(movie_genres) & set(ign))) == len(ign): - log.info2("%s has blacklisted genre(s): %s" % (movie['original_title'], ign)) + log.info2('%s has blacklisted genre(s): %s', (movie['original_title'], ign)) return False return True diff --git a/couchpotato/core/providers/automation/rottentomatoes/main.py b/couchpotato/core/providers/automation/rottentomatoes/main.py index 053b79e..b448202 100644 --- a/couchpotato/core/providers/automation/rottentomatoes/main.py +++ b/couchpotato/core/providers/automation/rottentomatoes/main.py @@ -35,10 +35,10 @@ class Rottentomatoes(Automation, RSS): name = result.group(0) if rating < tryInt(self.conf('tomatometer_percent')): - log.info2('%s seems to be rotten...' % name) + log.info2('%s seems to be rotten...', name) else: - log.info2('Found %s fresh enough movies, enqueuing: %s' % (rating, name)) + log.info2('Found %s fresh enough movies, enqueuing: %s', (rating, name)) year = datetime.datetime.now().strftime("%Y") imdb = self.search(name, year) diff --git a/couchpotato/core/providers/base.py b/couchpotato/core/providers/base.py index 1f0df96..809ec61 100644 --- a/couchpotato/core/providers/base.py +++ b/couchpotato/core/providers/base.py @@ -179,7 +179,7 @@ class YarrProvider(Provider): if hostname in download_url: return self except: - log.debug('Url % s doesn\'t belong to %s', (url, self.getName())) + log.debug('Url %s doesn\'t belong to %s', (url, self.getName())) return diff --git a/couchpotato/core/providers/torrent/passthepopcorn/main.py b/couchpotato/core/providers/torrent/passthepopcorn/main.py index 9abe51f..3f2d16d 100644 --- a/couchpotato/core/providers/torrent/passthepopcorn/main.py +++ b/couchpotato/core/providers/torrent/passthepopcorn/main.py @@ -58,7 +58,7 @@ class PassThePopcorn(TorrentProvider): class PTPHTTPRedirectHandler(urllib2.HTTPRedirectHandler): def http_error_302(self, req, fp, code, msg, headers): - log.debug("302 detected; redirected to %s" % headers['Location']) + log.debug("302 detected; redirected to %s", headers['Location']) if (headers['Location'] != 'login.php'): return urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers) else: @@ -84,7 +84,7 @@ class PassThePopcorn(TorrentProvider): txt = self.urlopen(url, opener = self.login_opener) res = json.loads(txt) except: - log.error('Search on PassThePopcorn.me (%s) failed (could not decode JSON)' % params) + log.error('Search on PassThePopcorn.me (%s) failed (could not decode JSON)', params) return try: @@ -96,10 +96,10 @@ class PassThePopcorn(TorrentProvider): for ptpmovie in res['Movies']: if not 'Torrents' in ptpmovie: - log.debug('Movie %s (%s) has NO torrents' % (ptpmovie['Title'], ptpmovie['Year'])) + log.debug('Movie %s (%s) has NO torrents', (ptpmovie['Title'], ptpmovie['Year'])) continue - log.debug('Movie %s (%s) has %d torrents' % (ptpmovie['Title'], ptpmovie['Year'], len(ptpmovie['Torrents']))) + log.debug('Movie %s (%s) has %d torrents', (ptpmovie['Title'], ptpmovie['Year'], len(ptpmovie['Torrents']))) for torrent in ptpmovie['Torrents']: torrent_id = tryInt(torrent['Id']) torrentdesc = '%s %s %s' % (torrent['Resolution'], torrent['Source'], torrent['Codec']) @@ -151,7 +151,7 @@ class PassThePopcorn(TorrentProvider): try: response = opener.open(self.urls['login'], self.getLoginParams()) except urllib2.URLError as e: - log.error('Login to PassThePopcorn failed: %s' % e) + log.error('Login to PassThePopcorn failed: %s', e) return False if response.getcode() == 200: @@ -159,7 +159,7 @@ class PassThePopcorn(TorrentProvider): self.login_opener = opener return True else: - log.error('Login to PassThePopcorn failed: returned code %d' % response.getcode()) + log.error('Login to PassThePopcorn failed: returned code %d', response.getcode()) return False def torrentMeetsQualitySpec(self, torrent, quality): @@ -172,7 +172,7 @@ class PassThePopcorn(TorrentProvider): seen_one = False if not field in torrent: - log.debug('Torrent with ID %s has no field "%s"; cannot apply post-search-filter for quality "%s"' % (torrent['Id'], field, quality)) + log.debug('Torrent with ID %s has no field "%s"; cannot apply post-search-filter for quality "%s"', (torrent['Id'], field, quality)) continue for spec in specs: