系统配置文件改为json类型,移除yaml的使用
This commit is contained in:
parent
987f1b6929
commit
bcbd556e7d
7 changed files with 17 additions and 17 deletions
|
@ -2,9 +2,6 @@ import json
|
|||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
from yamlcore import CoreLoader
|
||||
|
||||
from launcher.config.conf import Conf
|
||||
|
||||
conf_path = Path(os.path.join(os.getcwd(), "conf.json"))
|
||||
|
@ -22,8 +19,8 @@ def load_conf():
|
|||
conf = Conf()
|
||||
save_conf()
|
||||
return
|
||||
with conf_path.open("r", encoding="utf-8") as f:
|
||||
data = yaml.load(f, Loader=CoreLoader)
|
||||
with conf_path.open("r", encoding="utf-8") as file:
|
||||
data = json.load(file)
|
||||
if data is None:
|
||||
data = {}
|
||||
conf = Conf(**data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue