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