diff --git a/SABnzbd.py b/SABnzbd.py index 1022d3e..c89f108 100755 --- a/SABnzbd.py +++ b/SABnzbd.py @@ -395,14 +395,15 @@ def print_modules(): if sabnzbd.decoder.SABYENC_VERSION: # We have a VERSION, thus a SABYenc module, but it's not the correct version logging.error( - T("SABYenc disabled: no correct version found! (Found v%s, expecting v%s)") - % (sabnzbd.decoder.SABYENC_VERSION, sabnzbd.constants.SABYENC_VERSION_REQUIRED) + T("SABYenc disabled: no correct version found! (Found v%s, expecting v%s)"), + sabnzbd.decoder.SABYENC_VERSION, + sabnzbd.constants.SABYENC_VERSION_REQUIRED, ) else: # No SABYenc module at all logging.error( - T("SABYenc module... NOT found! Expecting v%s - https://sabnzbd.org/sabyenc") - % sabnzbd.constants.SABYENC_VERSION_REQUIRED + T("SABYenc module... NOT found! Expecting v%s - https://sabnzbd.org/sabyenc"), + sabnzbd.constants.SABYENC_VERSION_REQUIRED, ) # Do not allow downloading sabnzbd.NO_DOWNLOADING = True @@ -419,9 +420,7 @@ def print_modules(): if sabnzbd.newsunpack.MULTIPAR_COMMAND: logging.info("MultiPar binary... found (%s)", sabnzbd.newsunpack.MULTIPAR_COMMAND) elif sabnzbd.WIN32: - logging.error( - "%s %s" % (T("MultiPar binary... NOT found!"), T("Verification and repair will not be possible.")) - ) + logging.error("%s %s", T("MultiPar binary... NOT found!"), T("Verification and repair will not be possible.")) if sabnzbd.newsunpack.RAR_COMMAND: logging.info("UNRAR binary... found (%s)", sabnzbd.newsunpack.RAR_COMMAND) @@ -430,9 +429,7 @@ def print_modules(): if sabnzbd.newsunpack.RAR_PROBLEM and not sabnzbd.cfg.ignore_wrong_unrar(): have_str = "%.2f" % (float(sabnzbd.newsunpack.RAR_VERSION) / 100) want_str = "%.2f" % (float(sabnzbd.constants.REC_RAR_VERSION) / 100) - logging.warning( - T("Your UNRAR version is %s, we recommend version %s or higher.
") % (have_str, want_str) - ) + logging.warning(T("Your UNRAR version is %s, we recommend version %s or higher.
"), have_str, want_str) elif not (sabnzbd.WIN32 or sabnzbd.DARWIN): logging.info("UNRAR binary version %.2f", (float(sabnzbd.newsunpack.RAR_VERSION) / 100)) else: @@ -1167,8 +1164,8 @@ def main(): logging.warning( T( "SABnzbd was started with encoding %s, this should be UTF-8. Expect problems with Unicoded file and directory names in downloads." - ) - % sabnzbd.encoding.CODEPAGE + ), + sabnzbd.encoding.CODEPAGE, ) # SSL Information diff --git a/sabnzbd/interface.py b/sabnzbd/interface.py index d8a33a1..169d2fe 100644 --- a/sabnzbd/interface.py +++ b/sabnzbd/interface.py @@ -342,7 +342,7 @@ def log_warning_and_ip(txt): ) else: txt = "%s %s>%s" % (txt, cherrypy.request.remote.ip, cherrypy.request.headers.get("User-Agent", "??")) - logging.warning("%s", txt) + logging.warning(txt) ############################################################################## diff --git a/sabnzbd/newsunpack.py b/sabnzbd/newsunpack.py index 94f11b1..55c911a 100644 --- a/sabnzbd/newsunpack.py +++ b/sabnzbd/newsunpack.py @@ -46,6 +46,7 @@ from sabnzbd.filesystem import ( recursive_listdir, setname_from_path, get_ext, + get_filename, ) from sabnzbd.sorting import SeriesSorter import sabnzbd.cfg as cfg @@ -669,7 +670,7 @@ def rar_extract(rarfile_path, numrars, one_folder, nzo, setname, extraction_path break if fail == 2: - logging.error("%s (%s)", T("Unpacking failed, archive requires a password"), os.path.split(rarfile_path)[1]) + logging.error("%s (%s)", T("Unpacking failed, archive requires a password"), get_filename(rarfile_path)) return fail, new_files, rars @@ -848,7 +849,7 @@ def rar_extract_core(rarfile_path, numrars, one_folder, nzo, setname, extraction p.kill() elif line.startswith("ERROR: "): - msg = T("ERROR: %s" % line[7:]) + msg = T("ERROR: %s") % line[7:] nzo.fail_msg = msg logging.warning(msg) nzo.set_unpack_info("Unpack", msg, setname) diff --git a/sabnzbd/notifier.py b/sabnzbd/notifier.py index d2fd025..e4acea8 100644 --- a/sabnzbd/notifier.py +++ b/sabnzbd/notifier.py @@ -360,7 +360,7 @@ def send_nscript(title, msg, gtype, force=False, test=None): if script_path: output, ret = external_script(script_path, gtype, title, msg, parameters) if ret: - logging.error(T('Script returned exit code %s and output "%s"') % (ret, output)) + logging.error(T('Script returned exit code %s and output "%s"'), ret, output) return T('Script returned exit code %s and output "%s"') % (ret, output) else: logging.info("Successfully executed notification script " + script_path)