fix config
This commit is contained in:
parent
31fc99d2bc
commit
1bcbd6501b
@ -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)}')
|
||||
@ -79,13 +86,6 @@ def try_load_deprecated_user_path_config():
|
||||
|
||||
try_load_deprecated_user_path_config()
|
||||
|
||||
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
|
||||
|
||||
if isinstance(preset, str):
|
||||
|
Loading…
Reference in New Issue
Block a user