perf: 初始化config对象时支持传递dict作为模板

This commit is contained in:
RockChinQ
2024-03-20 14:20:56 +08:00
parent f53070d8b6
commit fa823de6b0
3 changed files with 21 additions and 19 deletions
+3 -2
View File
@@ -43,11 +43,12 @@ async def load_python_module_config(config_name: str, template_name: str) -> Con
return cfg_mgr
async def load_json_config(config_name: str, template_name: str) -> ConfigManager:
async def load_json_config(config_name: str, template_name: str=None, template_data: dict=None) -> ConfigManager:
"""加载JSON配置文件"""
cfg_inst = json_file.JSONConfigFile(
config_name,
template_name
template_name,
template_data
)
cfg_mgr = ConfigManager(cfg_inst)