Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

feat: 根据系统语言选择语言#780

Merged
IsHPDuwu merged 3 commits into
Class-Widgets:mainfrom
IsHPDuwu:feat/i18n.system_lang
Jul 21, 2025
Merged

feat: 根据系统语言选择语言#780
IsHPDuwu merged 3 commits into
Class-Widgets:mainfrom
IsHPDuwu:feat/i18n.system_lang

Conversation

@IsHPDuwu

Copy link
Copy Markdown
Member

No description provided.

@IsHPDuwu IsHPDuwu requested a review from baiyao105 July 21, 2025 04:16
@github-actions

Copy link
Copy Markdown

🧪 静态检查结果

检查已完成(16408385861) - [🔄 PR检查],以下为结果

🕒 检查时间:2025-07-21 04:17:36 UTC / 2025-07-21 12:17:36 UTC+8
📝 触发提交信息2fd52c1: "fix: ."
📁 检查的文件数:1 个 - menu.py


🚨 严重错误

❌ MyPy 严重错误(点我展开)
file.py:208: error: Incompatible default for argument "old_section" (default has type "None", argument has type "str")  [assignment]
file.py:208: error: Incompatible default for argument "old_key" (default has type "None", argument has type "str")  [assignment]
file.py:208: error: Incompatible default for argument "new_section" (default has type "None", argument has type "str")  [assignment]
file.py:209: error: Incompatible default for argument "new_key" (default has type "None", argument has type "str")  [assignment]
utils.py:230: error: Unsupported operand types for < ("datetime" and "float")  [operator]
utils.py:231: error: Unsupported operand types for >= ("datetime" and "float")  [operator]
utils.py:234: error: Argument "seconds" to "timedelta" has incompatible type "Union[float, datetime]"; expected "float"  [arg-type]
utils.py:573: error: Incompatible types in assignment (expression has type "datetime", variable has type "Optional[float]")  [assignment]
utils.py:607: error: Unsupported operand types for - ("float" and "None")  [operator]
utils.py:608: error: Returning Any from function declared to return "datetime"  [no-any-return]
utils.py:608: error: Unsupported operand types for + ("float" and "timedelta")  [operator]
utils.py:629: error: Incompatible return value type (got "float", expected "int")  [return-value]
utils.py:664: error: Incompatible return value type (got "Optional[float]", expected "Optional[datetime]")  [return-value]
utils.py:698: error: Unexpected keyword argument "config" for "TimeManagerInterface"  [call-arg]
list_.py:118: error: Need type annotation for "not_exist_themes" (hint: "not_exist_themes: List[<type>] = ...")  [var-annotated]
list_.py:212: error: Missing return statement  [return]
list_.py:229: error: Returning Any from function declared to return "str"  [no-any-return]
list_.py:315: error: Argument 1 to "len" has incompatible type "Optional[Any]"; expected "Sized"  [arg-type]
list_.py:368: error: Returning Any from function declared to return "List[str]"  [no-any-return]
conf.py:79: error: Returning Any from function declared to return "Optional[Dict[str, Any]]"  [no-any-return]
conf.py:87: error: Item "None" of "Optional[Dict[str, Any]]" has no attribute "update"  [union-attr]
conf.py:98: error: Incompatible types in assignment (expression has type "Dict[str, List[Any]]", variable has type "List[Any]")  [assignment]
conf.py:127: error: Argument 1 to "Path" has incompatible type "Optional[str]"; expected "Union[str, PathLike[str]]"  [arg-type]
conf.py:172: error: Incompatible types in assignment (expression has type "Path", variable has type "str")  [assignment]
conf.py:173: error: Incompatible types in assignment (expression has type "Union[Path, str]", variable has type "str")  [assignment]
conf.py:176: error: Argument 1 to "Path" has incompatible type "Optional[str]"; expected "Union[str, PathLike[str]]"  [arg-type]
conf.py:179: error: "str" has no attribute "stem"  [attr-defined]
conf.py:186: error: "str" has no attribute "parent"  [attr-defined]
conf.py:192: error: Argument 1 to "join" has incompatible type "Optional[str]"; expected "str"  [arg-type]
conf.py:205: error: Incompatible types in assignment (expression has type "float", variable has type "int")  [assignment]
conf.py:292: error: Need type annotation for "plugin_dict" (hint: "plugin_dict: Dict[<type>, <type>] = ...")  [var-annotated]
plugin.py:25: error: Item "None" of "Optional[Dict[str, Any]]" has no attribute "get"  [union-attr]
plugin.py:26: error: Unsupported right operand type for in ("Optional[Dict[str, Any]]")  [operator]
plugin.py:27: error: Value of type "Optional[Dict[str, Any]]" is not indexable  [index]
plugin.py:30: error: Item "None" of "Optional[Dict[str, Any]]" has no attribute "get"  [union-attr]
plugin.py:31: error: Value of type "Optional[Dict[str, Any]]" is not indexable  [index]
plugin.py:32: error: Unsupported target for indexed assignment ("Optional[Dict[str, Any]]")  [index]
plugin.py:33: error: Argument 1 to "save_plugin_config" has incompatible type "Optional[Dict[str, Any]]"; expected "Dict[str, Any]"  [arg-type]
plugin.py:39: error: Value of type "Optional[Dict[str, Any]]" is not indexable  [index]
plugin.py:62: error: Value of type "Optional[Dict[str, Any]]" is not indexable  [index]
plugin.py:63: error: Value of type "Optional[Dict[str, Any]]" is not indexable  [index]
plugin.py:64: error: Argument 1 to "save_plugin_config" has incompatible type "Optional[Dict[str, Any]]"; expected "Dict[str, Any]"  [arg-type]
plugin.py:83: error: Item "None" of "Optional[Dict[str, Any]]" has no attribute "get"  [union-attr]
plugin.py:84: error: Value of type "Optional[Dict[str, Any]]" is not indexable  [index]
plugin.py:85: error: Unsupported right operand type for in ("Optional[Dict[str, Any]]")  [operator]
plugin.py:86: error: Unsupported target for indexed assignment ("Optional[Dict[str, Any]]")  [index]
plugin.py:87: error: Value of type "Optional[Dict[str, Any]]" is not indexable  [index]
plugin.py:88: error: Value of type "Optional[Dict[str, Any]]" is not indexable  [index]
plugin.py:89: error: Argument 1 to "save_plugin_config" has incompatible type "Optional[Dict[str, Any]]"; expected "Dict[str, Any]"  [arg-type]
plugin.py:99: error: Item "None" of "Optional[Any]" has no attribute "get_app_contexts"  [union-attr]

📋 其他检查

🔍 PyLint 提示(点我展开)
************* Module menu
menu.py:68:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:91:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:94:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:101:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:129:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:134:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:142:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:180:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:192:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:218:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:221:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:223:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:227:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:233:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:239:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:244:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:246:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:254:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:503:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:574:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:751:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens)
menu.py:755:22: C0303: Trailing whitespace (trailing-whitespace)
menu.py:780:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:783:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:792:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:834:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:838:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:858:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:943:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
menu.py:1001:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1027:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1040:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1046:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1051:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1061:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1089:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1107:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1111:17: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1123:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1127:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1138:37: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1139:92: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1148:32: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1149:94: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1155:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1162:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1176:41: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1177:96: C0303: Trailing whitespace (trailing-whitespace)
menu.py:1186:36: C0303: Trailing whitespace (trailing-whitespace)
🔍 MyPy 提示(点我展开)
file.py:208: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
file.py:208: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
file.py:209: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
file.py:209: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
utils.py:230: note: Right operand is of type "Union[float, datetime]"
utils.py:231: note: Right operand is of type "Union[float, datetime]"
utils.py:607: note: Right operand is of type "Optional[float]"
.venv/lib/python3.8/site-packages/mypy/typeshed/stdlib/builtins.pyi:110: note: "TimeManagerInterface" defined here
weather.py:1368: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
weather.py:1368: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
network_thread.py:430: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
network_thread.py:430: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
menu.py:2479: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
menu.py:2479: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
menu.py:2488: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
menu.py:2488: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
menu.py:3133: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
menu.py:3133: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
menu.py:3142: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
menu.py:3142: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
Found 650 errors in 13 files (checked 1 source file)

@IsHPDuwu IsHPDuwu merged commit 9486d1b into Class-Widgets:main Jul 21, 2025
6 of 7 checks passed
pizeroLOL pushed a commit to pizeroLOL/Class-Widgets that referenced this pull request Aug 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants