mirror of
https://github.com/KenanZhu/AutoLibrary.git
synced 2026-06-18 07:23:03 +08:00
style(utils.ConfigManager): 添加一些注释,并为 getBaseConfigDir 添加文档字符串。
This commit is contained in:
@@ -175,9 +175,12 @@ class ConfigManager:
|
|||||||
return self.__config_dir
|
return self.__config_dir
|
||||||
|
|
||||||
|
|
||||||
|
# ConfigManager singleton instance.
|
||||||
_config_manager_instance = None
|
_config_manager_instance = None
|
||||||
|
|
||||||
# Utility function to get config data (thread-safe and validated) from ConfigManager instance.
|
# Utility functions.
|
||||||
|
#
|
||||||
|
# Utility function to get validated automation config paths.
|
||||||
def getValidateAutomationConfigPaths(
|
def getValidateAutomationConfigPaths(
|
||||||
) -> dict:
|
) -> dict:
|
||||||
"""
|
"""
|
||||||
@@ -204,8 +207,16 @@ def getValidateAutomationConfigPaths(
|
|||||||
_config_manager_instance.set(ConfigType.GLOBAL, "automation", auto_config)
|
_config_manager_instance.set(ConfigType.GLOBAL, "automation", auto_config)
|
||||||
return config_paths
|
return config_paths
|
||||||
|
|
||||||
|
# Utility function to get base config directory.
|
||||||
def getBaseConfigDir(
|
def getBaseConfigDir(
|
||||||
) -> str:
|
) -> str:
|
||||||
|
"""
|
||||||
|
Get base config directory, on Windows, it is usually at :
|
||||||
|
'C:\\Users\\<username>\\AppData\\Local\\AutoLibrary\\config'.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
str: Base config directory.
|
||||||
|
"""
|
||||||
|
|
||||||
return _config_manager_instance.configDir()
|
return _config_manager_instance.configDir()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user