mirror of
https://github.com/Radiquum/anixart-patcher.git
synced 2025-09-06 11:13:51 +05:00
refactor: tqdm -> rich.progress
This commit is contained in:
parent
43b1406b4a
commit
7b5ba163bd
10 changed files with 260 additions and 141 deletions
15
config.py
15
config.py
|
@ -30,18 +30,31 @@ class ConfigFolders(TypedDict):
|
|||
dist: str
|
||||
|
||||
|
||||
class ConfigXmlNS(TypedDict):
|
||||
android: str
|
||||
app: str
|
||||
|
||||
|
||||
class Config(TypedDict):
|
||||
log_level: str
|
||||
tools: list[ConfigTools]
|
||||
folders: ConfigFolders
|
||||
xml_ns: ConfigXmlNS
|
||||
|
||||
|
||||
def load_config() -> Config:
|
||||
config = None
|
||||
|
||||
if not os.path.exists("config.json"):
|
||||
log.exception("file `config.json` is not found!")
|
||||
exit(1)
|
||||
|
||||
with open("./config.json", "r", encoding="utf-8") as file:
|
||||
return json.loads(file.read())
|
||||
config = json.loads(file.read())
|
||||
|
||||
log.setLevel(config.get("log_level", "NOTSET").upper())
|
||||
|
||||
return config
|
||||
|
||||
|
||||
config = load_config()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue