mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-10 15:04:55 +08:00
Another batch of linter fixes
This commit is contained in:
parent
67ea2bb446
commit
b1799a9586
6 changed files with 9 additions and 7 deletions
|
@ -258,8 +258,7 @@ def convert_to_commented_map(
|
|||
return CommentedMap(
|
||||
{k: convert_to_commented_map(v) for k, v in source_dict.items()}
|
||||
)
|
||||
else:
|
||||
return source_dict
|
||||
return source_dict
|
||||
|
||||
|
||||
def get_default_config() -> dict:
|
||||
|
|
|
@ -49,6 +49,6 @@ def _t(*args, **kwargs):
|
|||
except TypeError as exc:
|
||||
logger.error("Translation failed: {}".format(exc))
|
||||
logger.error("Arguments: {}".format(*args))
|
||||
if len(args) > 0:
|
||||
return args[0]
|
||||
return args
|
||||
if len(args) > 0:
|
||||
return args[0]
|
||||
return args
|
||||
|
|
|
@ -219,8 +219,10 @@ def send_prometheus_metrics(
|
|||
upload_metrics(destination, authentication, no_cert_verify, metrics)
|
||||
else:
|
||||
write_metrics_file(destination, metrics, append=append_metrics_file)
|
||||
return True
|
||||
else:
|
||||
logger.debug("No metrics destination set. Not sending metrics")
|
||||
return True
|
||||
|
||||
|
||||
def send_metrics_mail(
|
||||
|
|
|
@ -26,7 +26,7 @@ def get_restic_internal_binary(arch: str) -> str:
|
|||
binary = None
|
||||
if os.path.isdir(RESTIC_SOURCE_FILES_DIR):
|
||||
if os.name == "nt":
|
||||
if IS_LEGACY or "legacy" in "arch":
|
||||
if IS_LEGACY or "legacy" in arch:
|
||||
# Last compatible restic binary for Windows 7, see https://github.com/restic/restic/issues/5065
|
||||
# We build a legacy version of restic for windows 7 and Server 2008R2
|
||||
logger.info(
|
||||
|
|
|
@ -38,6 +38,7 @@ def handle_current_window(action: str = "minimize") -> None:
|
|||
|
||||
current_executable = os.path.abspath(sys.argv[0])
|
||||
# console window will have the name of current executable
|
||||
# pylint: disable=I1101 (c-extension-no-member)
|
||||
hWnd = win32gui.FindWindow(None, current_executable)
|
||||
if not hWnd:
|
||||
logger.debug(
|
||||
|
|
|
@ -350,7 +350,7 @@ def gui_thread_runner(
|
|||
if __fn_name == "restore":
|
||||
try:
|
||||
stdout_cache = json.dumps(json.loads(stdout_cache), indent=4)
|
||||
except json.JSONDecodeError as exc:
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
# Don't update GUI if there isn't anything to update so it will avoid scrolling back to top every second
|
||||
if (
|
||||
|
|
Loading…
Add table
Reference in a new issue