Merge remote-tracking branch 'upstream/main'

# Conflicts:
#	modules/config.py
This commit is contained in:
Manuel Schmid 2024-02-04 14:29:54 +01:00
commit 6dadc3314d
No known key found for this signature in database
GPG Key ID: 32C4F7569B40B84B
1 changed files with 8 additions and 8 deletions

View File

@ -16,10 +16,17 @@ config_dict = {}
always_save_keys = []
visited_keys = []
try:
with open(os.path.abspath(f'./presets/default.json'), "r", encoding="utf-8") as json_file:
config_dict.update(json.load(json_file))
except Exception as e:
print(f'Load default preset failed.')
print(e)
try:
if os.path.exists(config_path):
with open(config_path, "r", encoding="utf-8") as json_file:
config_dict = json.load(json_file)
config_dict.update(json.load(json_file))
always_save_keys = list(config_dict.keys())
except Exception as e:
print(f'Failed to load config file "{config_path}" . The reason is: {str(e)}')
@ -127,13 +134,6 @@ def try_load_preset_global(preset):
print(e)
try:
with open(os.path.abspath(f'./presets/default.json'), "r", encoding="utf-8") as json_file:
config_dict.update(json.load(json_file))
except Exception as e:
print(f'Load default preset failed.')
print(e)
preset = args_manager.args.preset
try_load_preset_global(preset)