mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Edit values. Don't delete them all
This commit is contained in:
parent
185702169a
commit
e701fc1888
@ -86,9 +86,13 @@ class Controller:
|
||||
self.project_root = root_dir
|
||||
|
||||
def set_config_json(self, data):
|
||||
keys = list(data.keys())
|
||||
current_config = self.helper.get_all_settings()
|
||||
for key in current_config:
|
||||
if key in data:
|
||||
current_config[key] = data[key]
|
||||
keys = list(current_config.keys())
|
||||
keys.sort()
|
||||
sorted_data = {i: data[i] for i in keys}
|
||||
sorted_data = {i: current_config[i] for i in keys}
|
||||
with open(self.helper.settings_file, "w", encoding="utf-8") as f:
|
||||
json.dump(sorted_data, f, indent=4)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user