From 9ae89b61a496aa568f51e7ab2f49f1d184473637 Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Wed, 4 Mar 2026 23:52:28 +0800 Subject: [PATCH] =?UTF-8?q?chore(utils.ConfigManager):=20=E5=B0=86=20Confi?= =?UTF-8?q?gManager=20=E7=B1=BB=E7=9A=84=20appDir=20=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E4=B8=BA=20configDir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/ConfigManager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/ConfigManager.py b/src/utils/ConfigManager.py index db211b3..dab90b6 100644 --- a/src/utils/ConfigManager.py +++ b/src/utils/ConfigManager.py @@ -168,7 +168,7 @@ class ConfigManager: JSONWriter(config_path, self.__config_data[config_type.value]) - def appDir( + def configDir( self ) -> str: @@ -193,7 +193,7 @@ def getValidateAutomationConfigPaths( paths = auto_config.get(f"{cfg_type}_path", {}).get("paths", []) index = auto_config.get(f"{cfg_type}_path", {}).get("current", 0) if paths == []: - paths.append(os.path.join(_config_manager_instance.appDir(), f"{cfg_type}.json")) + paths.append(os.path.join(_config_manager_instance.configDir(), f"{cfg_type}.json")) if index < 0: index = 0 if index >= len(paths): @@ -207,7 +207,7 @@ def getValidateAutomationConfigPaths( def getBaseConfigDir( ) -> str: - return _config_manager_instance.appDir() + return _config_manager_instance.configDir() # Singleton instance of ConfigManager. _instance_lock = threading.Lock() @@ -227,7 +227,7 @@ def instance( else: if config_dir == "": return _config_manager_instance - if _config_manager_instance.appDir() != config_dir: + if getBaseConfigDir() != config_dir: raise ValueError( "ConfigManager 的实例已初始化,不能使用不同的配置目录。") return _config_manager_instance