From 4e1716d58b4e4d4be80b2889aeaae49f22510789 Mon Sep 17 00:00:00 2001 From: Jesse Mullan Date: Sat, 1 Nov 2014 16:33:35 -0700 Subject: [PATCH] Fix E712 comparison to True should be 'if cond is True:' or 'if cond:' --- headphones/cuesplit.py | 4 ++-- headphones/searcher.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/headphones/cuesplit.py b/headphones/cuesplit.py index 33da38e8..01ed54f8 100755 --- a/headphones/cuesplit.py +++ b/headphones/cuesplit.py @@ -278,9 +278,9 @@ class File: def get_name(self, ext=True, cmd=False): - if ext == True: + if ext is True: content = self.name - elif ext == False: + elif ext is False: content = self.name_name elif ext[0] == '.': content = self.name_name + ext diff --git a/headphones/searcher.py b/headphones/searcher.py index f5293333..f065ae6a 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -1128,7 +1128,7 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None): if not torrent or (int(torrent.find(".mp3")) > 0 and int(torrent.find(".flac")) < 1): rightformat = False - if rightformat == True and size < maxsize and minimumseeders < int(seeders): + if rightformat and size < maxsize and minimumseeders < int(seeders): resultlist.append((title, size, url, provider, 'torrent')) logger.info('Found %s. Size: %s' % (title, helpers.bytes_to_mb(size))) else: @@ -1436,10 +1436,9 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None): size = int(item.links[1]['length']) if format == "2": torrent = request.request_content(url) - if not torrent or (int(torrent.find(".mp3")) > 0 and int(torrent.find(".flac")) < 1): rightformat = False - if rightformat == True and size < maxsize and minimumseeders < seeds: + if rightformat and size < maxsize and minimumseeders < seeds: resultlist.append((title, size, url, provider, 'torrent')) logger.info('Found %s. Size: %s' % (title, helpers.bytes_to_mb(size))) else: