Skip to content

Commit

Permalink
Automatically fill persistent settings with missing
Browse files Browse the repository at this point in the history
parameters new in this version.
  • Loading branch information
JoeZiminski committed Apr 10, 2024
1 parent 8bf64ee commit 5139e06
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion datashuttle/datashuttle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1436,9 +1436,18 @@ def _update_settings_with_new_canonical_keys(self, settings: Dict):
and the new keys need adding.
If changing keys within the top level (e.g. a dict entry in
"tui") this method will need to be extended.
Added keys:
v0.4.0: tui "overwrite_existing_files" and "dry_run"
"""
if "name_templates" not in settings:
settings.update(canonical_configs.get_name_templates_defaults())

canonical_tui_configs = canonical_configs.get_tui_config_defaults()

if "tui" not in settings:
settings.update(canonical_configs.get_tui_config_defaults())
settings.update(canonical_tui_configs)

for key in ["overwrite_existing_files", "dry_run"]:
if key not in settings["tui"]:
settings["tui"][key] = canonical_tui_configs["tui"][key]

0 comments on commit 5139e06

Please sign in to comment.