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

feat(weather): 自定义气象预警排除#815

Merged
baiyao105 merged 5 commits into
Class-Widgets:mainfrom
baiyao105:feat/weather.alertec
Aug 1, 2025
Merged

feat(weather): 自定义气象预警排除#815
baiyao105 merged 5 commits into
Class-Widgets:mainfrom
baiyao105:feat/weather.alertec

Conversation

@baiyao105

Copy link
Copy Markdown
Member
  • 潦草写写。

@baiyao105 baiyao105 requested a review from IsHPDuwu August 1, 2025 15:11
@github-actions

github-actions Bot commented Aug 1, 2025

Copy link
Copy Markdown

🧪 静态检查结果

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

🕒 检查时间:2025-08-01 16:03:06 UTC / 2025-08-02 00:03:06 UTC+8
📝 触发提交信息00a4ffa: "只搜索标题。"
📁 检查的文件数:3 个 - main.py,menu.py,weather.py


🚨 严重错误

❌ PyLint 严重错误(点我展开)
main.py:804:8: E0606: Possibly using variable 'p_mgr' before assignment (possibly-used-before-assignment)
main.py:960:26: E0606: Possibly using variable 'app' before assignment (possibly-used-before-assignment)
main.py:2710:30: E0606: Possibly using variable 'pygetwindow' before assignment (possibly-used-before-assignment)
❌ MyPy 严重错误(点我展开)
file.py:198: error: Incompatible default for argument "old_section" (default has type "None", argument has type "str")  [assignment]
file.py:198: error: Incompatible default for argument "old_key" (default has type "None", argument has type "str")  [assignment]
file.py:198: error: Incompatible default for argument "new_section" (default has type "None", argument has type "str")  [assignment]
file.py:199: error: Incompatible default for argument "new_key" (default has type "None", argument has type "str")  [assignment]
generate_speech.py:119: error: Returning Any from function declared to return "Optional[str]"  [no-any-return]
generate_speech.py:502: error: Call to untyped function "EdgeTTSProvider" in typed context  [no-untyped-call]
generate_speech.py:503: error: Call to untyped function "Pyttsx3Provider" in typed context  [no-untyped-call]
generate_speech.py:688: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")  [assignment]
generate_speech.py:693: error: Incompatible types in assignment (expression has type "None", variable has type "str")  [assignment]
generate_speech.py:771: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")  [assignment]
generate_speech.py:776: error: Incompatible types in assignment (expression has type "None", variable has type "str")  [assignment]
utils.py:77: error: Item "None" of "Optional[SingleInstanceGuard]" has no attribute "release"  [union-attr]
utils.py:116: error: Item "None" of "Optional[SingleInstanceGuard]" has no attribute "release"  [union-attr]
utils.py:241: error: Unsupported operand types for < ("datetime" and "float")  [operator]
utils.py:242: error: Unsupported operand types for >= ("datetime" and "float")  [operator]
utils.py:245: error: Argument "seconds" to "timedelta" has incompatible type "Union[float, datetime]"; expected "float"  [arg-type]
utils.py:523: error: Incompatible return value type (got "float", expected "int")  [return-value]
utils.py:597: error: Incompatible types in assignment (expression has type "datetime", variable has type "Optional[float]")  [assignment]
utils.py:631: error: Unsupported operand types for - ("float" and "None")  [operator]
utils.py:632: error: Returning Any from function declared to return "datetime"  [no-any-return]
utils.py:632: error: Unsupported operand types for + ("float" and "timedelta")  [operator]
utils.py:657: error: Incompatible return value type (got "float", expected "int")  [return-value]
utils.py:692: error: Incompatible return value type (got "Optional[float]", expected "Optional[datetime]")  [return-value]
utils.py:726: 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]
play_audio.py:71: error: Module "conf" does not explicitly export attribute "base_directory"  [attr-defined]
play_audio.py:97: error: Module "conf" does not explicitly export attribute "base_directory"  [attr-defined]
play_audio.py:107: error: Module "conf" does not explicitly export attribute "base_directory"  [attr-defined]
play_audio.py:181: error: Call to untyped function "AudioManager" in typed context  [no-untyped-call]
cses_mgr.py:50: error: Missing type parameters for generic type "Dict"  [type-arg]
cses_mgr.py:134: error: Need type annotation for "class_counter_dict" (hint: "class_counter_dict: Dict[<type>, <type>] = ...")  [var-annotated]
cses_mgr.py:135: error: Cannot determine type of "parts"  [has-type]
cses_mgr.py:136: error: Cannot determine type of "part_names"  [has-type]
cses_mgr.py:137: error: Cannot determine type of "parts"  [has-type]

📋 其他检查

🔍 PyLint 提示(点我展开)
************* Module main
main.py:136:15: C0303: Trailing whitespace (trailing-whitespace)
main.py:160:57: C0303: Trailing whitespace (trailing-whitespace)
main.py:161:53: C0303: Trailing whitespace (trailing-whitespace)
main.py:162:26: C0303: Trailing whitespace (trailing-whitespace)
main.py:164:31: C0303: Trailing whitespace (trailing-whitespace)
main.py:251:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:308:14: C0303: Trailing whitespace (trailing-whitespace)
main.py:361:80: C0303: Trailing whitespace (trailing-whitespace)
main.py:392:83: C0303: Trailing whitespace (trailing-whitespace)
main.py:439:0: W0311: Bad indentation. Found 36 spaces, expected 32 (bad-indentation)
main.py:465:53: C0303: Trailing whitespace (trailing-whitespace)
main.py:466:57: C0303: Trailing whitespace (trailing-whitespace)
main.py:467:57: C0303: Trailing whitespace (trailing-whitespace)
main.py:483:35: C0303: Trailing whitespace (trailing-whitespace)
main.py:489:0: C0325: Unnecessary parens after ':=' keyword (superfluous-parens)
main.py:619:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:733:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1293:0: W0311: Bad indentation. Found 17 spaces, expected 16 (bad-indentation)
main.py:1294:0: W0311: Bad indentation. Found 21 spaces, expected 20 (bad-indentation)
main.py:1295:0: W0311: Bad indentation. Found 21 spaces, expected 20 (bad-indentation)
main.py:1296:0: W0311: Bad indentation. Found 25 spaces, expected 24 (bad-indentation)
main.py:1298:0: W0311: Bad indentation. Found 25 spaces, expected 24 (bad-indentation)
main.py:1299:0: W0311: Bad indentation. Found 29 spaces, expected 28 (bad-indentation)
main.py:1300:0: W0311: Bad indentation. Found 25 spaces, expected 24 (bad-indentation)
main.py:1301:0: W0311: Bad indentation. Found 17 spaces, expected 16 (bad-indentation)
main.py:1302:0: W0311: Bad indentation. Found 21 spaces, expected 20 (bad-indentation)
main.py:1312:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1456:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1491:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1539:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1554:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1571:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1576:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1582:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1586:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1597:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1643:0: W0311: Bad indentation. Found 13 spaces, expected 12 (bad-indentation)
main.py:1656:34: C0303: Trailing whitespace (trailing-whitespace)
main.py:1788:0: C0303: Trailing whitespace (trailing-whitespace)
main.py:1931:0: W0311: Bad indentation. Found 17 spaces, expected 16 (bad-indentation)
main.py:1932:0: W0311: Bad indentation. Found 21 spaces, expected 20 (bad-indentation)
main.py:1933:0: W0311: Bad indentation. Found 21 spaces, expected 20 (bad-indentation)
main.py:1934:0: W0311: Bad indentation. Found 25 spaces, expected 24 (bad-indentation)
main.py:1936:0: W0311: Bad indentation. Found 25 spaces, expected 24 (bad-indentation)
main.py:1937:0: W0311: Bad indentation. Found 29 spaces, expected 28 (bad-indentation)
main.py:1938:0: W0311: Bad indentation. Found 25 spaces, expected 24 (bad-indentation)
main.py:1939:0: W0311: Bad indentation. Found 17 spaces, expected 16 (bad-indentation)
main.py:1940:0: W0311: Bad indentation. Found 21 spaces, expected 20 (bad-indentation)
main.py:1990:79: C0303: Trailing whitespace (trailing-whitespace)
🔍 MyPy 提示(点我展开)
file.py:198: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
file.py:198: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
file.py:199: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
file.py:199: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
utils.py:241: note: Right operand is of type "Union[float, datetime]"
utils.py:242: note: Right operand is of type "Union[float, datetime]"
utils.py:631: note: Right operand is of type "Optional[float]"
.venv/lib/python3.8/site-packages/mypy/typeshed/stdlib/builtins.pyi:110: note: "TimeManagerInterface" defined here
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:2524: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
menu.py:2524: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
menu.py:2533: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
menu.py:2533: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
main.py:1632: note: Right operand is of type "Optional[Any]"
Found 878 errors in 15 files (checked 3 source files)

@IsHPDuwu IsHPDuwu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其他应该没啥问题

Comment thread view/menu/custom.ui Outdated
@baiyao105 baiyao105 requested a review from IsHPDuwu August 1, 2025 15:47
@baiyao105 baiyao105 linked an issue Aug 1, 2025 that may be closed by this pull request
@baiyao105 baiyao105 merged commit 10fad13 into Class-Widgets:main Aug 1, 2025
12 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.

[FEATURE]: 自定义天气预警排除

2 participants