mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 01:23:55 +08:00
update:格式化代码
This commit is contained in:
+7
-2
@@ -1,10 +1,15 @@
|
||||
import os
|
||||
import argparse
|
||||
from core.utils.util import read_config
|
||||
from core.utils.util import read_config, get_project_dir
|
||||
|
||||
|
||||
def load_config():
|
||||
"""加载配置文件"""
|
||||
parser = argparse.ArgumentParser(description="Server configuration")
|
||||
parser.add_argument("--config_path", type=str, default="config.yaml")
|
||||
default_config_file = "config.yaml"
|
||||
# 判断是否存在私有的配置文件
|
||||
if os.path.exists(get_project_dir() + "." + default_config_file):
|
||||
default_config_file = "." + default_config_file
|
||||
parser.add_argument("--config_path", type=str, default=default_config_file)
|
||||
args = parser.parse_args()
|
||||
return read_config(args.config_path)
|
||||
|
||||
Reference in New Issue
Block a user