ruff检查问题修复

This commit is contained in:
li-xiaochen 2024-12-14 20:52:05 +08:00
parent effcc2874e
commit 94009c8136
3 changed files with 6 additions and 14 deletions

View file

@ -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():

View file

@ -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)}")

View file

@ -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