mirror of
https://github.com/netinvent/npbackup.git
synced 2025-11-12 23:23:50 +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,7 +258,6 @@ def convert_to_commented_map(
|
||||||
return CommentedMap(
|
return CommentedMap(
|
||||||
{k: convert_to_commented_map(v) for k, v in source_dict.items()}
|
{k: convert_to_commented_map(v) for k, v in source_dict.items()}
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
return source_dict
|
return source_dict
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -219,8 +219,10 @@ def send_prometheus_metrics(
|
||||||
upload_metrics(destination, authentication, no_cert_verify, metrics)
|
upload_metrics(destination, authentication, no_cert_verify, metrics)
|
||||||
else:
|
else:
|
||||||
write_metrics_file(destination, metrics, append=append_metrics_file)
|
write_metrics_file(destination, metrics, append=append_metrics_file)
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
logger.debug("No metrics destination set. Not sending metrics")
|
logger.debug("No metrics destination set. Not sending metrics")
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def send_metrics_mail(
|
def send_metrics_mail(
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ def get_restic_internal_binary(arch: str) -> str:
|
||||||
binary = None
|
binary = None
|
||||||
if os.path.isdir(RESTIC_SOURCE_FILES_DIR):
|
if os.path.isdir(RESTIC_SOURCE_FILES_DIR):
|
||||||
if os.name == "nt":
|
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
|
# 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
|
# We build a legacy version of restic for windows 7 and Server 2008R2
|
||||||
logger.info(
|
logger.info(
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ def handle_current_window(action: str = "minimize") -> None:
|
||||||
|
|
||||||
current_executable = os.path.abspath(sys.argv[0])
|
current_executable = os.path.abspath(sys.argv[0])
|
||||||
# console window will have the name of current executable
|
# console window will have the name of current executable
|
||||||
|
# pylint: disable=I1101 (c-extension-no-member)
|
||||||
hWnd = win32gui.FindWindow(None, current_executable)
|
hWnd = win32gui.FindWindow(None, current_executable)
|
||||||
if not hWnd:
|
if not hWnd:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
|
||||||
|
|
@ -350,7 +350,7 @@ def gui_thread_runner(
|
||||||
if __fn_name == "restore":
|
if __fn_name == "restore":
|
||||||
try:
|
try:
|
||||||
stdout_cache = json.dumps(json.loads(stdout_cache), indent=4)
|
stdout_cache = json.dumps(json.loads(stdout_cache), indent=4)
|
||||||
except json.JSONDecodeError as exc:
|
except json.JSONDecodeError:
|
||||||
pass
|
pass
|
||||||
# Don't update GUI if there isn't anything to update so it will avoid scrolling back to top every second
|
# Don't update GUI if there isn't anything to update so it will avoid scrolling back to top every second
|
||||||
if (
|
if (
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue