Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/function/maintain/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@
]

class 配置信息:
"""
存放有关 Sundry 配置文件(config.json)的信息。
"""

默认配置: dict[str, Any] = {
"$schema": "https://duckduckstudio.github.io/yazicbs.github.io/Tools/Sundry/config/schema/1.4.json",
"version": "1.4",
"debug": False,
"paths": {
"winget-pkgs": "",
"winget-tools": ""
"winget-pkgs": None,
"winget-tools": None
},
"repos": {
"winget-pkgs": "",
"winget-tools": ""
"winget-pkgs": None,
"winget-tools": None
},
"git": {
"retry_interval": 50,
Expand Down Expand Up @@ -240,7 +244,7 @@ def 读取配置项(配置项: 所有配置项 | str, 静默: bool = False) -> s
return 当前字典[最后键]
else:
if not 静默:
print(f"{MSHead.Error} 读取配置文件失败:\n{Fore.RED}值 \"{配置项}\" 为空{Fore.RESET}")
print(f"{MSHead.Error} 读取配置文件失败:\n{Fore.RED}\"{配置项}\" 的值为空 (null){Fore.RESET}")
print(f"{MSHead.Message} 运行 sundry config {配置项} <值> 来修改配置文件中的值")
return None
except KeyError as e:
Expand Down
Loading