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:
+2
-2
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user