Merge pull request #19 from catboxanon/utf8

Fix config load/save
pull/20/head
Haoming 2023-12-03 04:07:42 +08:00 committed by GitHub
commit ea23e0658d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -5,12 +5,12 @@ import json
VERSION = 'v1.5.0'
def clean_outdated(EXT_NAME:str):
with open(scripts.basedir() + '/' + 'ui-config.json', 'r') as json_file:
with open(scripts.basedir() + '/' + 'ui-config.json', 'r', encoding='utf8') as json_file:
configs = json.loads(json_file.read())
cleaned_configs = {key: value for key, value in configs.items() if EXT_NAME not in key}
with open(scripts.basedir() + '/' + 'ui-config.json', 'w') as json_file:
with open(scripts.basedir() + '/' + 'ui-config.json', 'w', encoding='utf8') as json_file:
json.dump(cleaned_configs, json_file)
def refresh_sliders():