refactor(modules): 添加类型注解并优化 WSL 检测

- 全模块补全类型注解 (files, after_update, on_change)
- docker: 仅在 WSL 环境禁用 networkd-wait-online
- docker: 添加 _is_wsl() 自动检测函数
- zsh/docker: 改进错误输出使用 decman.error
- wsl-init: 统一使用 [[ ]] 并格式化代码
This commit is contained in:
2026-04-09 12:09:00 +08:00
parent 4182b3c300
commit b96e144e82
6 changed files with 54 additions and 35 deletions
+2 -2
View File
@@ -6,11 +6,11 @@ class LocaleModule(Module):
def __init__(self):
super().__init__("locale")
def files(self):
def files(self) -> dict[str, File]:
return {
"/etc/locale.conf": File(content="LANG=en_US.UTF-8\n"),
"/etc/locale.gen": File(content="en_US.UTF-8 UTF-8\n"),
}
def on_change(self, store):
def on_change(self, store: object) -> None:
decman.prg(["locale-gen"])