mirror of
https://github.com/netinvent/npbackup.git
synced 2025-11-08 05:04:45 +08:00
Reformat file with black
This commit is contained in:
parent
efd468b5ab
commit
27050e8dc9
3 changed files with 15 additions and 20 deletions
|
|
@ -177,7 +177,7 @@ empty_config_dict = {
|
|||
"repo_opts": {
|
||||
"repo_password": None,
|
||||
"repo_password_command": None,
|
||||
"compression": "auto", # Can be auto, max, off
|
||||
"compression": "auto", # Can be auto, max, off
|
||||
# Minimum time between two backups, in minutes
|
||||
# Set to zero in order to disable time checks
|
||||
"minimum_backup_age": 1435,
|
||||
|
|
@ -848,28 +848,26 @@ def _migrate_config_dict(full_config: dict, old_version: str, new_version: str)
|
|||
f"{object_type} {object_name} has no retention policy, skipping migration"
|
||||
)
|
||||
return full_config
|
||||
|
||||
|
||||
def _migrate_compression_3_0_0_to_3_0_4(
|
||||
full_config: dict,
|
||||
object_name: str,
|
||||
object_type: str,
|
||||
) -> dict:
|
||||
try:
|
||||
if full_config.g(
|
||||
f"{object_type}.{object_name}.repo_opts.compression"
|
||||
) is None and f"{object_type}.{object_name}.backup_opts.compression" is not None:
|
||||
if (
|
||||
full_config.g(f"{object_type}.{object_name}.repo_opts.compression")
|
||||
is None
|
||||
and f"{object_type}.{object_name}.backup_opts.compression" is not None
|
||||
):
|
||||
full_config.s(
|
||||
f"{object_type}.{object_name}.repo_opts.compression",
|
||||
full_config.g(
|
||||
f"{object_type}.{object_name}.backup_opts.compression"
|
||||
),
|
||||
)
|
||||
full_config.d(
|
||||
f"{object_type}.{object_name}.backup_opts.compression"
|
||||
)
|
||||
logger.info(
|
||||
f"Migrated {object_name} compression to repo_opts"
|
||||
)
|
||||
full_config.d(f"{object_type}.{object_name}.backup_opts.compression")
|
||||
logger.info(f"Migrated {object_name} compression to repo_opts")
|
||||
except KeyError:
|
||||
logger.info(
|
||||
f"{object_type} {object_name} has no compression, skipping migration"
|
||||
|
|
|
|||
|
|
@ -1222,18 +1222,14 @@ def config_gui(full_config: dict, config_file: str):
|
|||
),
|
||||
],
|
||||
[
|
||||
sg.Text(
|
||||
_t("config_gui.pack_size"), size=(20, 1)
|
||||
),
|
||||
sg.Text(_t("config_gui.pack_size"), size=(20, 1)),
|
||||
sg.Image(
|
||||
NON_INHERITED_ICON,
|
||||
key="inherited.backup_opts.pack_size",
|
||||
tooltip=_t("config_gui.group_inherited"),
|
||||
pad=1,
|
||||
),
|
||||
sg.Input(
|
||||
key="backup_opts.pack_size", size=(8, 1)
|
||||
),
|
||||
sg.Input(key="backup_opts.pack_size", size=(8, 1)),
|
||||
],
|
||||
]
|
||||
),
|
||||
|
|
@ -1603,7 +1599,8 @@ def config_gui(full_config: dict, config_file: str):
|
|||
NON_INHERITED_ICON,
|
||||
key="inherited_repo_group",
|
||||
tooltip=_t("config_gui.group_inherited"),
|
||||
pad=1),
|
||||
pad=1,
|
||||
),
|
||||
sg.Combo(
|
||||
values=configuration.get_group_list(full_config),
|
||||
key="repo_group",
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ class ResticRunner:
|
|||
self._no_lock = value
|
||||
else:
|
||||
raise ValueError("Bogus no_lock value given")
|
||||
|
||||
|
||||
@property
|
||||
def compression(self) -> str:
|
||||
return self._compression
|
||||
|
|
@ -297,7 +297,7 @@ class ResticRunner:
|
|||
self._pack_size = value
|
||||
else:
|
||||
raise ValueError("Bogus pack_size value given")
|
||||
|
||||
|
||||
@property
|
||||
def json_output(self) -> bool:
|
||||
return self._json_output
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue