|
@ -106,6 +106,16 @@ def guard_loglevel(): |
|
|
LOG_FLAG = True |
|
|
LOG_FLAG = True |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def warning_helpfull(*args, **kwargs): |
|
|
|
|
|
""" Wrapper to ignore helpfull warnings if desired """ |
|
|
|
|
|
if sabnzbd.cfg.helpfull_warnings(): |
|
|
|
|
|
return logging.warning(*args, **kwargs) |
|
|
|
|
|
return logging.info(*args, **kwargs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logging.warning_helpfull = warning_helpfull |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GUIHandler(logging.Handler): |
|
|
class GUIHandler(logging.Handler): |
|
|
""" Logging handler collects the last warnings/errors/exceptions |
|
|
""" Logging handler collects the last warnings/errors/exceptions |
|
|
to be displayed in the web-gui |
|
|
to be displayed in the web-gui |
|
@ -280,7 +290,7 @@ def identify_web_template(key, defweb, wdir): |
|
|
full_main = real_path(full_dir, DEF_MAIN_TMPL) |
|
|
full_main = real_path(full_dir, DEF_MAIN_TMPL) |
|
|
|
|
|
|
|
|
if not os.path.exists(full_main): |
|
|
if not os.path.exists(full_main): |
|
|
logging.warning(T("Cannot find web template: %s, trying standard template"), full_main) |
|
|
logging.warning_helpfull(T("Cannot find web template: %s, trying standard template"), full_main) |
|
|
full_dir = real_path(sabnzbd.DIR_INTERFACES, DEF_STDINTF) |
|
|
full_dir = real_path(sabnzbd.DIR_INTERFACES, DEF_STDINTF) |
|
|
full_main = real_path(full_dir, DEF_MAIN_TMPL) |
|
|
full_main = real_path(full_dir, DEF_MAIN_TMPL) |
|
|
if not os.path.exists(full_main): |
|
|
if not os.path.exists(full_main): |
|
@ -423,10 +433,12 @@ def print_modules(): |
|
|
logging.info("UNRAR binary... found (%s)", sabnzbd.newsunpack.RAR_COMMAND) |
|
|
logging.info("UNRAR binary... found (%s)", sabnzbd.newsunpack.RAR_COMMAND) |
|
|
|
|
|
|
|
|
# Report problematic unrar |
|
|
# Report problematic unrar |
|
|
if sabnzbd.newsunpack.RAR_PROBLEM and not sabnzbd.cfg.ignore_wrong_unrar(): |
|
|
if sabnzbd.newsunpack.RAR_PROBLEM: |
|
|
have_str = "%.2f" % (float(sabnzbd.newsunpack.RAR_VERSION) / 100) |
|
|
have_str = "%.2f" % (float(sabnzbd.newsunpack.RAR_VERSION) / 100) |
|
|
want_str = "%.2f" % (float(sabnzbd.constants.REC_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.<br />"), have_str, want_str) |
|
|
logging.warning_helpfull( |
|
|
|
|
|
T("Your UNRAR version is %s, we recommend version %s or higher.<br />"), have_str, want_str |
|
|
|
|
|
) |
|
|
elif not (sabnzbd.WIN32 or sabnzbd.DARWIN): |
|
|
elif not (sabnzbd.WIN32 or sabnzbd.DARWIN): |
|
|
logging.info("UNRAR binary version %.2f", (float(sabnzbd.newsunpack.RAR_VERSION) / 100)) |
|
|
logging.info("UNRAR binary version %.2f", (float(sabnzbd.newsunpack.RAR_VERSION) / 100)) |
|
|
else: |
|
|
else: |
|
@ -596,7 +608,9 @@ def get_webhost(cherryhost, cherryport, https_port): |
|
|
logging.info("IPV6 has priority on this system, potential Firefox issue") |
|
|
logging.info("IPV6 has priority on this system, potential Firefox issue") |
|
|
|
|
|
|
|
|
if ipv6 and ipv4 and cherryhost == "" and sabnzbd.WIN32: |
|
|
if ipv6 and ipv4 and cherryhost == "" and sabnzbd.WIN32: |
|
|
logging.warning(T("Please be aware the 0.0.0.0 hostname will need an IPv6 address for external access")) |
|
|
logging.warning_helpfull( |
|
|
|
|
|
T("Please be aware the 0.0.0.0 hostname will need an IPv6 address for external access") |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
if cherryhost == "localhost" and not sabnzbd.WIN32 and not sabnzbd.DARWIN: |
|
|
if cherryhost == "localhost" and not sabnzbd.WIN32 and not sabnzbd.DARWIN: |
|
|
# On the Ubuntu family, localhost leads to problems for CherryPy |
|
|
# On the Ubuntu family, localhost leads to problems for CherryPy |
|
@ -847,7 +861,6 @@ def main(): |
|
|
pid_path = None |
|
|
pid_path = None |
|
|
pid_file = None |
|
|
pid_file = None |
|
|
new_instance = False |
|
|
new_instance = False |
|
|
osx_console = False |
|
|
|
|
|
ipv6_hosting = None |
|
|
ipv6_hosting = None |
|
|
|
|
|
|
|
|
_service, sab_opts, _serv_opts, upload_nzbs = commandline_handler() |
|
|
_service, sab_opts, _serv_opts, upload_nzbs = commandline_handler() |
|
@ -1157,7 +1170,7 @@ def main(): |
|
|
|
|
|
|
|
|
# On Linux/FreeBSD/Unix "UTF-8" is strongly, strongly adviced: |
|
|
# On Linux/FreeBSD/Unix "UTF-8" is strongly, strongly adviced: |
|
|
if not sabnzbd.WIN32 and not sabnzbd.DARWIN and not ("utf-8" in sabnzbd.encoding.CODEPAGE.lower()): |
|
|
if not sabnzbd.WIN32 and not sabnzbd.DARWIN and not ("utf-8" in sabnzbd.encoding.CODEPAGE.lower()): |
|
|
logging.warning( |
|
|
logging.warning_helpfull( |
|
|
T( |
|
|
T( |
|
|
"SABnzbd was started with encoding %s, this should be UTF-8. Expect problems with Unicoded file and directory names in downloads." |
|
|
"SABnzbd was started with encoding %s, this should be UTF-8. Expect problems with Unicoded file and directory names in downloads." |
|
|
), |
|
|
), |
|
|