mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-05 12:18:21 +02:00
if option.json is not found, it will be created
This commit is contained in:
parent
4e1f5b98d0
commit
1698df8426
1 changed files with 12 additions and 0 deletions
|
@ -1,4 +1,14 @@
|
||||||
import json
|
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):
|
def change_option(self, option, value, restart=False):
|
||||||
|
@ -9,4 +19,6 @@ def change_option(self, option, value, restart=False):
|
||||||
|
|
||||||
|
|
||||||
def load_option(self):
|
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)
|
with open("./option.json", encoding="utf-8") as f: self.option = json.load(f)
|
Loading…
Reference in a new issue