diff --git a/launcher/config/__init__.py b/launcher/config/__init__.py index b36e8f2..972e9a5 100644 --- a/launcher/config/__init__.py +++ b/launcher/config/__init__.py @@ -1,26 +1,18 @@ import json import os +from pathlib import Path import yaml -from yamlcore import CoreDumper, CoreLoader +from yamlcore import CoreLoader from launcher.config.conf import Conf -from pathlib import Path conf_path = Path(os.path.join(os.getcwd(), "conf.json")) def save_conf(): with conf_path.open("w", encoding="utf8") as f: - json.dump(conf.model_dump(), f, ensure_ascii=False, indent=4) # Use json.dump - # yaml.dump( - # conf.model_dump(), - # f, - # Dumper=CoreDumper, - # encoding="utf-8", - # default_flow_style=False, - # allow_unicode=True, - # ) + json.dump(conf.model_dump(), f, ensure_ascii=False, indent=4) def load_conf(): diff --git a/launcher/sys_config/__init__.py b/launcher/sys_config/__init__.py index d50d859..f0a93bf 100644 --- a/launcher/sys_config/__init__.py +++ b/launcher/sys_config/__init__.py @@ -1,5 +1,5 @@ -import sys import os +import sys import yaml @@ -44,7 +44,7 @@ class SysConfig: except FileNotFoundError: pass # logger.error(f"配置文件未找到: {self.config_path}") - except Exception as e: + except Exception: pass # logger.error(f"加载配置文件时出错: {str(e)}") diff --git a/launcher/webview/__init__.py b/launcher/webview/__init__.py index d2dea2f..6371a19 100644 --- a/launcher/webview/__init__.py +++ b/launcher/webview/__init__.py @@ -1,7 +1,7 @@ import webview -from launcher.webview.api import Api from launcher.sys_config import sys_config +from launcher.webview.api import Api window = None