if option.json is not found, it will be created

This commit is contained in:
raphael60650 2021-06-18 13:02:56 +02:00
parent 4e1f5b98d0
commit 1698df8426

View file

@ -1,4 +1,14 @@
import json
import os
default_option = {
"language": "en",
"format": "WBFS",
"disable_download": False,
"del_track_after_conv": False,
"dont_check_for_update": False,
"process_track": 8
}
def change_option(self, option, value, restart=False):
@ -9,4 +19,6 @@ def change_option(self, option, value, restart=False):
def load_option(self):
if not(os.path.exists("./option.json")):
with open("./option.json", "w", encoding="utf-8") as f: json.dump(default_option, f, ensure_ascii=False)
with open("./option.json", encoding="utf-8") as f: self.option = json.load(f)