From 7a7ce477698d7a7c792bc83c1ef78e83e392f39b Mon Sep 17 00:00:00 2001 From: Safihre Date: Wed, 5 Sep 2018 11:23:08 +0200 Subject: [PATCH] Remove redundant parentheses --- SABnzbd.py | 30 +++++++++++++++--------------- sabnzbd/__init__.py | 8 ++++---- sabnzbd/api.py | 10 +++++----- sabnzbd/assembler.py | 6 +++--- sabnzbd/constants.py | 2 +- sabnzbd/database.py | 4 ++-- sabnzbd/decoder.py | 2 +- sabnzbd/directunpacker.py | 8 ++++---- sabnzbd/interface.py | 2 +- sabnzbd/misc.py | 12 ++++++------ sabnzbd/newsunpack.py | 4 ++-- sabnzbd/newswrapper.py | 28 ++++++++++++++-------------- sabnzbd/notifier.py | 2 +- sabnzbd/nzbqueue.py | 8 ++++---- sabnzbd/nzbstuff.py | 10 +++++----- sabnzbd/osxmenu.py | 8 ++++---- sabnzbd/sorting.py | 2 +- sabnzbd/utils/certgen.py | 3 +-- sabnzbd/utils/checkdir.py | 2 +- sabnzbd/utils/getperformance.py | 2 +- scripts/Deobfuscate.py | 12 ++++++------ tools/extract_pot.py | 2 +- 22 files changed, 83 insertions(+), 84 deletions(-) diff --git a/SABnzbd.py b/SABnzbd.py index a08ef9c..79f6d11 100755 --- a/SABnzbd.py +++ b/SABnzbd.py @@ -659,12 +659,12 @@ def attach_server(host, port, cert=None, key=None, chain=None): def is_sabnzbd_running(url): """ Return True when there's already a SABnzbd instance running. """ try: - url = '%s&mode=version' % (url) + url = '%s&mode=version' % url # Do this without certificate verification, few installations will have that prev = sabnzbd.set_https_verification(False) ver = get_from_url(url) sabnzbd.set_https_verification(prev) - return (ver and (re.search(r'\d+\.\d+\.', ver) or ver.strip() == sabnzbd.__version__)) + return ver and (re.search(r'\d+\.\d+\.', ver) or ver.strip() == sabnzbd.__version__) except: return False @@ -864,9 +864,9 @@ def main(): elif opt in ('-b', '--browser'): try: autobrowser = bool(int(arg)) - except: + except ValueError: autobrowser = True - elif opt in ('--autorestarted', ): + elif opt == '--autorestarted': autorestarted = True elif opt in ('-c', '--clean'): clean_up = True @@ -885,36 +885,36 @@ def main(): exit_sab(0) elif opt in ('-p', '--pause'): pause = True - elif opt in ('--https',): + elif opt == '--https': https_port = int(arg) sabnzbd.RESTART_ARGS.append(opt) sabnzbd.RESTART_ARGS.append(arg) - elif opt in ('--repair',): + elif opt == '--repair': repair = 1 pause = True - elif opt in ('--repair-all',): + elif opt == '--repair-all': repair = 2 pause = True - elif opt in ('--log-all',): + elif opt == '--log-all': sabnzbd.LOG_ALL = True - elif opt in ('--disable-file-log'): + elif opt == '--disable-file-log': no_file_log = True - elif opt in ('--no-login',): + elif opt == '--no-login': no_login = True - elif opt in ('--pid',): + elif opt == '--pid': pid_path = arg sabnzbd.RESTART_ARGS.append(opt) sabnzbd.RESTART_ARGS.append(arg) - elif opt in ('--pidfile',): + elif opt == '--pidfile': pid_file = arg sabnzbd.RESTART_ARGS.append(opt) sabnzbd.RESTART_ARGS.append(arg) - elif opt in ('--new',): + elif opt == '--new': new_instance = True - elif opt in ('--console',): + elif opt == '--console': sabnzbd.RESTART_ARGS.append(opt) osx_console = True - elif opt in ('--ipv6_hosting',): + elif opt == '--ipv6_hosting': ipv6_hosting = arg sabnzbd.MY_FULLNAME = os.path.normpath(os.path.abspath(sabnzbd.MY_FULLNAME)) diff --git a/sabnzbd/__init__.py b/sabnzbd/__init__.py index 431ffd3..2dce6d7 100644 --- a/sabnzbd/__init__.py +++ b/sabnzbd/__init__.py @@ -1008,12 +1008,12 @@ def pp_to_opts(pp): # Convert the pp to an int pp = sabnzbd.interface.int_conv(pp) if pp == 0: - return (False, False, False) + return False, False, False if pp == 1: - return (True, False, False) + return True, False, False if pp == 2: - return (True, True, False) - return (True, True, True) + return True, True, False + return True, True, True def opts_to_pp(repair, unpack, delete): diff --git a/sabnzbd/api.py b/sabnzbd/api.py index e63699c..4529003 100644 --- a/sabnzbd/api.py +++ b/sabnzbd/api.py @@ -1350,10 +1350,10 @@ def build_queue(start=0, limit=0, trans=False, output=None, search=None): # Ensure compatibility of API status if status == Status.DELETED or priority == TOP_PRIORITY: status = Status.DOWNLOADING - slot['status'] = "%s" % (status) + slot['status'] = "%s" % status - if (Downloader.do.paused or Downloader.do.postproc or is_propagating or \ - status not in (Status.DOWNLOADING, Status.FETCHING, Status.QUEUED)) and priority != TOP_PRIORITY: + if (Downloader.do.paused or Downloader.do.postproc or is_propagating or + status not in (Status.DOWNLOADING, Status.FETCHING, Status.QUEUED)) and priority != TOP_PRIORITY: slot['timeleft'] = '0:00:00' slot['eta'] = 'unknown' else: @@ -1705,7 +1705,7 @@ def build_queue_header(search=None, start=0, limit=0, output=None): except: header['eta'] = T('unknown') - return (header, qnfo.list, bytespersec, qnfo.q_fullsize, qnfo.bytes_left_previous_page) + return header, qnfo.list, bytespersec, qnfo.q_fullsize, qnfo.bytes_left_previous_page def build_history(start=None, limit=None, verbose=False, verbose_list=None, search=None, failed_only=0, @@ -1858,7 +1858,7 @@ def build_history(start=None, limit=None, verbose=False, verbose_list=None, sear if close_db: history_db.close() - return (items, fetched_items, total_items) + return items, fetched_items, total_items def get_active_history(queue=None, items=None): diff --git a/sabnzbd/assembler.py b/sabnzbd/assembler.py index 2b10e3d..4bebada 100644 --- a/sabnzbd/assembler.py +++ b/sabnzbd/assembler.py @@ -334,11 +334,11 @@ def nzo_filtered_by_rating(nzo): nzo.rating_filtered = 1 reason = rating_filtered(rating, nzo.filename.lower(), True) if reason is not None: - return (2, reason) + return 2, reason reason = rating_filtered(rating, nzo.filename.lower(), False) if reason is not None: - return (1, reason) - return (0, "") + return 1, reason + return 0, "" def rating_filtered(rating, filename, abort): diff --git a/sabnzbd/constants.py b/sabnzbd/constants.py index 6207247..bde8877 100644 --- a/sabnzbd/constants.py +++ b/sabnzbd/constants.py @@ -123,7 +123,7 @@ year_match = r'[\W]([1|2]\d{3})([^\w]|$)' # Something '(YYYY)' or '.YYYY.' or ' sample_match = r'((^|[\W_])(sample|proof))' # something-sample or something-proof -class Status(): +class Status: COMPLETED = 'Completed' # PP: Job is finished CHECKING = 'Checking' # Q: Pre-check is running DOWNLOADING = 'Downloading' # Q: Normal downloading diff --git a/sabnzbd/database.py b/sabnzbd/database.py index 1aba8a8..5f425fb 100644 --- a/sabnzbd/database.py +++ b/sabnzbd/database.py @@ -314,7 +314,7 @@ class HistoryDB(object): # Stage Name is separated by ::: stage lines by ; and stages by \r\n items = [unpack_history_info(item) for item in items] - return (items, fetched_items, total_items) + return items, fetched_items, total_items def have_episode(self, series, season, episode): """ Check whether History contains this series episode """ @@ -375,7 +375,7 @@ class HistoryDB(object): except AttributeError: pass - return (total, month, week) + return total, month, week def get_script_log(self, nzo_id): """ Return decompressed log file """ diff --git a/sabnzbd/decoder.py b/sabnzbd/decoder.py index fed9415..3ad15c5 100644 --- a/sabnzbd/decoder.py +++ b/sabnzbd/decoder.py @@ -378,7 +378,7 @@ def yCheck(data): except IndexError: break - return ((ybegin, ypart, yend), data) + return (ybegin, ypart, yend), data # Example: =ybegin part=1 line=128 size=123 name=-=DUMMY=- abc.par YSPLIT_RE = re.compile(r'([a-zA-Z0-9]+)=') diff --git a/sabnzbd/directunpacker.py b/sabnzbd/directunpacker.py index 437f6ed..5971ecd 100644 --- a/sabnzbd/directunpacker.py +++ b/sabnzbd/directunpacker.py @@ -176,10 +176,10 @@ class DirectUnpacker(threading.Thread): break # Error? Let PP-handle it - if linebuf.endswith(('ERROR: ', 'Cannot create', 'in the encrypted file', 'CRC failed', \ - 'checksum failed', 'You need to start extraction from a previous volume', \ - 'password is incorrect', 'Write error', 'checksum error', \ - 'start extraction from a previous volume')): + if linebuf.endswith(('ERROR: ', 'Cannot create', 'in the encrypted file', 'CRC failed', + 'checksum failed', 'You need to start extraction from a previous volume', + 'password is incorrect', 'Write error', 'checksum error', + 'start extraction from a previous volume')): logging.info('Error in DirectUnpack of %s', self.cur_setname) self.abort() diff --git a/sabnzbd/interface.py b/sabnzbd/interface.py index 58cacd3..6b4ce15 100644 --- a/sabnzbd/interface.py +++ b/sabnzbd/interface.py @@ -2765,7 +2765,7 @@ def rss_history(url, limit=50, search=None): stageLine.append("
Stage %s
" % stage['name']) actions = [] for action in stage['actions']: - actions.append("
%s
" % (action)) + actions.append("
%s
" % action) actions.sort() actions.reverse() for act in actions: diff --git a/sabnzbd/misc.py b/sabnzbd/misc.py index 244c844..d9be8fd 100644 --- a/sabnzbd/misc.py +++ b/sabnzbd/misc.py @@ -427,7 +427,7 @@ def is_obfuscated_filename(filename): """ Check if this file has an extension, if not, it's probably obfuscated and we don't use it """ - return (os.path.splitext(filename)[1] == '') + return os.path.splitext(filename)[1] == '' ############################################################################## @@ -519,16 +519,16 @@ def create_real_path(name, loc, path, umask=False, writable=True): logging.info('%s directory: %s does not exist, try to create it', name, my_dir) if not create_all_dirs(my_dir, umask): logging.error(T('Cannot create directory %s'), clip_path(my_dir)) - return (False, my_dir) + return False, my_dir checks = (os.W_OK + os.R_OK) if writable else os.R_OK if os.access(my_dir, checks): - return (True, my_dir) + return True, my_dir else: logging.error(T('%s directory: %s error accessing'), name, clip_path(my_dir)) - return (False, my_dir) + return False, my_dir else: - return (False, "") + return False, "" def is_relative_path(p): @@ -846,7 +846,7 @@ def split_host(srv): port = int(port) except: port = None - return (host, port) + return host, port def get_from_url(url): diff --git a/sabnzbd/newsunpack.py b/sabnzbd/newsunpack.py index 47ecfc5..1db8c25 100644 --- a/sabnzbd/newsunpack.py +++ b/sabnzbd/newsunpack.py @@ -1378,7 +1378,7 @@ def PAR_Verify(parfile, nzo, setname, joinables, single=False): elif line.startswith('Repair is possible'): start = time.time() - nzo.set_action_line(T('Repairing'), '%2d%%' % (0)) + nzo.set_action_line(T('Repairing'), '%2d%%' % 0) elif line.startswith('Repairing:'): chunks = line.split() @@ -1855,7 +1855,7 @@ def MultiPar_Verify(parfile, nzo, setname, joinables, single=False): # Before this it will calculate matrix, here is where it starts start = time.time() in_repair = True - nzo.set_action_line(T('Repairing'), '%2d%%' % (0)) + nzo.set_action_line(T('Repairing'), '%2d%%' % 0) elif in_repair and line.startswith('Verifying repair'): in_repair = False diff --git a/sabnzbd/newswrapper.py b/sabnzbd/newswrapper.py index a854e35..318d5a2 100644 --- a/sabnzbd/newswrapper.py +++ b/sabnzbd/newswrapper.py @@ -175,14 +175,14 @@ class NNTP(object): ctx = ssl.create_default_context() # Only verify hostname when we're strict - if(nw.server.ssl_verify < 2): + if nw.server.ssl_verify < 2: ctx.check_hostname = False # Certificates optional - if(nw.server.ssl_verify == 0): + if nw.server.ssl_verify == 0: ctx.verify_mode = ssl.CERT_NONE # Did the user set a custom cipher-string? - if(nw.server.ssl_ciphers): + if nw.server.ssl_ciphers: # At their own risk, socket will error out in case it was invalid ctx.set_ciphers(nw.server.ssl_ciphers) @@ -374,19 +374,19 @@ class NewsWrapper(object): self.timeout = time.time() + self.server.timeout if precheck: if self.server.have_stat: - command = 'STAT <%s>\r\n' % (self.article.article) + command = 'STAT <%s>\r\n' % self.article.article else: - command = 'HEAD <%s>\r\n' % (self.article.article) + command = 'HEAD <%s>\r\n' % self.article.article elif self.server.have_body: - command = 'BODY <%s>\r\n' % (self.article.article) + command = 'BODY <%s>\r\n' % self.article.article else: - command = 'ARTICLE <%s>\r\n' % (self.article.article) + command = 'ARTICLE <%s>\r\n' % self.article.article self.nntp.sock.sendall(command) self.data = [] def send_group(self, group): self.timeout = time.time() + self.server.timeout - command = 'GROUP %s\r\n' % (group) + command = 'GROUP %s\r\n' % group self.nntp.sock.sendall(command) self.data = [] @@ -414,7 +414,7 @@ class NewsWrapper(object): # time.sleep(0.0001) continue else: - return (0, False, True) + return 0, False, True # Data is processed differently depending on C-yEnc version if sabnzbd.decoder.SABYENC_ENABLED: @@ -424,16 +424,16 @@ class NewsWrapper(object): # Official end-of-article is ".\r\n" but sometimes it can get lost between 2 chunks chunk_len = len(chunk) if chunk[-5:] == '\r\n.\r\n': - return (chunk_len, True, False) + return chunk_len, True, False elif chunk_len < 5 and len(self.data) > 1: # We need to make sure the end is not split over 2 chunks # This is faster than join() combine_chunk = self.data[-2][-5:] + chunk if combine_chunk[-5:] == '\r\n.\r\n': - return (chunk_len, True, False) + return chunk_len, True, False # Still in middle of data, so continue! - return (chunk_len, False, False) + return chunk_len, False, False else: self.last_line += chunk new_lines = self.last_line.split('\r\n') @@ -457,9 +457,9 @@ class NewsWrapper(object): if self.lines and self.lines[-1] == '.': self.lines = self.lines[1:-1] - return (len(chunk), True, False) + return len(chunk), True, False else: - return (len(chunk), False, False) + return len(chunk), False, False def soft_reset(self): self.timeout = None diff --git a/sabnzbd/notifier.py b/sabnzbd/notifier.py index 9b64bd2..6f26b34 100644 --- a/sabnzbd/notifier.py +++ b/sabnzbd/notifier.py @@ -142,7 +142,7 @@ def check_cat(section, job_cat, keyword=None): if not keyword: keyword = section section_cats = sabnzbd.config.get_config(section, '%s_cats' % keyword)() - return (['*'] == section_cats or job_cat in section_cats) + return ['*'] == section_cats or job_cat in section_cats except TypeError: logging.debug('Incorrect Notify option %s:%s_cats', section, section) return True diff --git a/sabnzbd/nzbqueue.py b/sabnzbd/nzbqueue.py index 6fd5fe2..600912c 100644 --- a/sabnzbd/nzbqueue.py +++ b/sabnzbd/nzbqueue.py @@ -540,10 +540,10 @@ class NzbQueue(object): nzo2 = self.__nzo_table[item_id_2] except KeyError: # One or both jobs missing - return (-1, 0) + return -1, 0 if nzo1 == nzo2: - return (-1, 0) + return -1, 0 # get the priorities of the two items nzo1_priority = nzo1.priority @@ -572,9 +572,9 @@ class NzbQueue(object): logging.info('Switching job [%s] %s => [%s] %s', item_id_pos1, item.final_name, item_id_pos2, self.__nzo_list[item_id_pos2].final_name) del self.__nzo_list[item_id_pos1] self.__nzo_list.insert(item_id_pos2, item) - return (item_id_pos2, nzo1.priority) + return item_id_pos2, nzo1.priority # If moving failed/no movement took place - return (-1, nzo1.priority) + return -1, nzo1.priority @NzbQueueLocker def move_up_bulk(self, nzo_id, nzf_ids, size): diff --git a/sabnzbd/nzbstuff.py b/sabnzbd/nzbstuff.py index f5fdc5b..46b5b2b 100644 --- a/sabnzbd/nzbstuff.py +++ b/sabnzbd/nzbstuff.py @@ -167,7 +167,7 @@ class Article(TryList): # if (server_check.priority() < found_priority and server_check.priority() < server.priority and not self.server_in_try_list(server_check)): if server_check.active and (server_check.priority < found_priority): if server_check.priority < server.priority: - if (not self.server_in_try_list(server_check)): + if not self.server_in_try_list(server_check): if log: logging.debug('Article %s | Server: %s | setting found priority to %s', self.article, server.host, server_check.priority) found_priority = server_check.priority @@ -317,7 +317,7 @@ class NzbFile(TryList): if found: self.bytes_left -= article.bytes - return (not self.articles) + return not self.articles def set_par2(self, setname, vol, blocks): """ Designate this this file as a par2 file """ @@ -1190,7 +1190,7 @@ class NzbObject(TryList): self.status = Status.QUEUED self.set_download_report() - return (file_done, post_done) + return file_done, post_done @synchronized(NZO_LOCK) def remove_saved_article(self, article): @@ -1291,8 +1291,8 @@ class NzbObject(TryList): # Convert input value = int_conv(value) - if value in (REPAIR_PRIORITY, TOP_PRIORITY, HIGH_PRIORITY, NORMAL_PRIORITY, \ - LOW_PRIORITY, DEFAULT_PRIORITY, PAUSED_PRIORITY, DUP_PRIORITY, STOP_PRIORITY): + if value in (REPAIR_PRIORITY, TOP_PRIORITY, HIGH_PRIORITY, NORMAL_PRIORITY, + LOW_PRIORITY, DEFAULT_PRIORITY, PAUSED_PRIORITY, DUP_PRIORITY, STOP_PRIORITY): self.priority = value return diff --git a/sabnzbd/osxmenu.py b/sabnzbd/osxmenu.py index 8b826a2..0d17149 100644 --- a/sabnzbd/osxmenu.py +++ b/sabnzbd/osxmenu.py @@ -208,7 +208,7 @@ class SABnzbdDelegate(NSObject): for speed in sorted(speeds.keys()): menu_speed_item = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_('%s' % (speeds[speed]), 'speedlimitAction:', '') - menu_speed_item.setRepresentedObject_("%s" % (speed)) + menu_speed_item.setRepresentedObject_("%s" % speed) self.menu_speed.addItem_(menu_speed_item) self.speed_menu_item.setSubmenu_(self.menu_speed) @@ -414,7 +414,7 @@ class SABnzbdDelegate(NSObject): if history['status'] != Status.COMPLETED: jobfailed = NSAttributedString.alloc().initWithString_attributes_(job, self.failedAttributes) menu_history_item.setAttributedTitle_(jobfailed) - menu_history_item.setRepresentedObject_("%s" % (path)) + menu_history_item.setRepresentedObject_("%s" % path) self.menu_history.addItem_(menu_history_item) else: menu_history_item = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(T('Empty'), '', '') @@ -483,9 +483,9 @@ class SABnzbdDelegate(NSObject): if self.state != "" and self.info != "": self.state_menu_item.setTitle_("%s - %s" % (self.state, self.info)) if self.info == "": - self.state_menu_item.setTitle_("%s" % (self.state)) + self.state_menu_item.setTitle_("%s" % self.state) else: - self.state_menu_item.setTitle_("%s" % (self.info)) + self.state_menu_item.setTitle_("%s" % self.info) except: logging.info("[osx] stateUpdate Exception %s" % (sys.exc_info()[0])) diff --git a/sabnzbd/sorting.py b/sabnzbd/sorting.py index 91bbd3a..1af849c 100644 --- a/sabnzbd/sorting.py +++ b/sabnzbd/sorting.py @@ -237,7 +237,7 @@ class SeriesSorter(object): one = '-'.join(extra_list) two = '-'.join(extra2_list) - return (one, two) + return one, two def get_shownames(self): """ Get the show name from the match object and format it """ diff --git a/sabnzbd/utils/certgen.py b/sabnzbd/utils/certgen.py index e055c64..dbe51d9 100644 --- a/sabnzbd/utils/certgen.py +++ b/sabnzbd/utils/certgen.py @@ -64,8 +64,7 @@ def generate_local_cert(private_key, days_valid=3560, output_file='cert.cert', L # build Subject Alternate Names (aka SAN) list # First the host names, add with x509.DNSName(): - san_list = [x509.DNSName(u"localhost")] - san_list.append(x509.DNSName(unicode(socket.gethostname()))) + san_list = [x509.DNSName(u"localhost"), x509.DNSName(unicode(socket.gethostname()))] # Then the host IP addresses, add with x509.IPAddress() # Inside a try-except, just to be sure diff --git a/sabnzbd/utils/checkdir.py b/sabnzbd/utils/checkdir.py index bcd2dae..6bf806c 100644 --- a/sabnzbd/utils/checkdir.py +++ b/sabnzbd/utils/checkdir.py @@ -49,7 +49,7 @@ def isFAT(dir): try: result = win32api.GetVolumeInformation(os.path.splitdrive(dir)[0]) if debug: print result - if(result[4].startswith("FAT")): + if result[4].startswith("FAT"): FAT = True except: pass diff --git a/sabnzbd/utils/getperformance.py b/sabnzbd/utils/getperformance.py index 0d44f2a..fd9ca04 100644 --- a/sabnzbd/utils/getperformance.py +++ b/sabnzbd/utils/getperformance.py @@ -20,7 +20,7 @@ def getcpu(): elif platform.system() == "Linux": for myline in open("/proc/cpuinfo"): - if myline.startswith(('model name')): + if myline.startswith('model name'): # Typical line: # model name : Intel(R) Xeon(R) CPU E5335 @ 2.00GHz cputype = myline.split(":", 1)[1] # get everything after the first ":" diff --git a/scripts/Deobfuscate.py b/scripts/Deobfuscate.py index f139998..8a747b9 100644 --- a/scripts/Deobfuscate.py +++ b/scripts/Deobfuscate.py @@ -91,7 +91,7 @@ def decodePar(parfile): result = False dir = os.path.dirname(parfile) with open(parfile, 'rb') as parfileToDecode: - while (True): + while True: header = parfileToDecode.read(STRUCT_PACKET_HEADER.size) if not header: break # file fully read @@ -99,7 +99,7 @@ def decodePar(parfile): bodyLength = packetLength - STRUCT_PACKET_HEADER.size # only process File Description packets - if (packetType != PACKET_TYPE_FILE_DESC): + if packetType != PACKET_TYPE_FILE_DESC: # skip this packet parfileToDecode.seek(bodyLength, os.SEEK_CUR) continue @@ -112,13 +112,13 @@ def decodePar(parfile): targetPath = path.join(dir, targetName) # file already exists, skip it - if (path.exists(targetPath)): + if path.exists(targetPath): print "File already exists: " + targetName continue # find and rename file srcPath = findFile(dir, filelength, hash16k) - if (srcPath is not None): + if srcPath is not None: os.rename(srcPath, targetPath) print "Renamed file from " + path.basename(srcPath) + " to " + targetName result = True @@ -132,7 +132,7 @@ def findFile(dir, filelength, hash16k): filepath = path.join(dir, filename) # check if the size matches as an indication - if (path.getsize(filepath) != filelength): continue + if path.getsize(filepath) != filelength: continue with open(filepath, 'rb') as fileToMatch: data = fileToMatch.read(16 * 1024) @@ -140,7 +140,7 @@ def findFile(dir, filelength, hash16k): m.update(data) # compare hash to confirm the match - if (m.digest() == hash16k): + if m.digest() == hash16k: return filepath return None diff --git a/tools/extract_pot.py b/tools/extract_pot.py index f67297f..8762b5c 100755 --- a/tools/extract_pot.py +++ b/tools/extract_pot.py @@ -27,7 +27,7 @@ import re f = open('sabnzbd/version.py') code = f.read() f.close() -exec(code) +exec code # Fixed information for the POT header HEADER = r'''#