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

feat: 自行增删课表数据库#722

Merged
IsHPDuwu merged 4 commits into
Class-Widgets:mainfrom
IsHPDuwu:chore/schedule.db
Jul 3, 2025
Merged

feat: 自行增删课表数据库#722
IsHPDuwu merged 4 commits into
Class-Widgets:mainfrom
IsHPDuwu:chore/schedule.db

Conversation

@IsHPDuwu

Copy link
Copy Markdown
Member

close #705

@IsHPDuwu IsHPDuwu requested review from baiyao105 and pizeroLOL June 29, 2025 06:51
@github-actions

github-actions Bot commented Jun 29, 2025

Copy link
Copy Markdown

🧪 静态检查结果

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

🕒 检查时间:2025-07-03 17:06:30 UTC / 2025-07-04 01:06:30 UTC+8
📝 触发提交信息4719e16: "空值检查"
📁 检查的文件数:2 个 - list_.py,menu.py


🚨 严重错误

❌ MyPy 严重错误(点我展开)
file.py:206: error: Incompatible default for argument "old_section" (default has type "None", argument has type "str")  [assignment]
file.py:206: error: Incompatible default for argument "old_key" (default has type "None", argument has type "str")  [assignment]
file.py:206: error: Incompatible default for argument "new_section" (default has type "None", argument has type "str")  [assignment]
file.py:207: 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:206: error: Missing return statement  [return]
list_.py:223: error: Returning Any from function declared to return "str"  [no-any-return]
list_.py:309: error: Argument 1 to "len" has incompatible type "Optional[Any]"; expected "Sized"  [arg-type]
list_.py:362: error: Returning Any from function declared to return "List[str]"  [no-any-return]
conf.py:77: error: Returning Any from function declared to return "Optional[Dict[str, Any]]"  [no-any-return]
conf.py:85: error: Item "None" of "Optional[Dict[str, Any]]" has no attribute "update"  [union-attr]
conf.py:96: error: Incompatible types in assignment (expression has type "Dict[str, List[Any]]", variable has type "List[Any]")  [assignment]
conf.py:125: error: Argument 1 to "Path" has incompatible type "Optional[str]"; expected "Union[str, PathLike[str]]"  [arg-type]
conf.py:170: error: Incompatible types in assignment (expression has type "Path", variable has type "str")  [assignment]
conf.py:171: error: Incompatible types in assignment (expression has type "Union[Path, str]", variable has type "str")  [assignment]
conf.py:174: error: Argument 1 to "Path" has incompatible type "Optional[str]"; expected "Union[str, PathLike[str]]"  [arg-type]
conf.py:177: error: "str" has no attribute "stem"  [attr-defined]
conf.py:184: error: "str" has no attribute "parent"  [attr-defined]
conf.py:190: error: Argument 1 to "join" has incompatible type "Optional[str]"; expected "str"  [arg-type]
conf.py:203: error: Incompatible types in assignment (expression has type "float", variable has type "int")  [assignment]
conf.py:290: 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]
plugin.py:106: error: Need type annotation for "widgets_to_remove" (hint: "widgets_to_remove: List[<type>] = ...")  [var-annotated]

📋 其他检查

🔍 PyLint 提示(点我展开)
************* Module list_
list_.py:338:0: C0303: Trailing whitespace (trailing-whitespace)
list_.py:111:0: C0206: Consider iterating with .items() (consider-using-dict-items)
list_.py:116:0: W0702: No exception type(s) specified (bare-except)
list_.py:114:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
list_.py:125:54: W0621: Redefining name 'f' from outer scope (line 114) (redefined-outer-name)
list_.py:130:11: W0718: Catching too general exception Exception (broad-exception-caught)
list_.py:137:14: W0621: Redefining name 'info' from outer scope (line 152) (redefined-outer-name)
list_.py:156:7: W0718: Catching too general exception Exception (broad-exception-caught)
list_.py:145:29: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
list_.py:194:14: W0612: Unused variable 'value' (unused-variable)
list_.py:201:8: W0612: Unused variable 'item' (unused-variable)
list_.py:207:4: C0200: Consider using enumerate instead of iterating with range and len (consider-using-enumerate)
list_.py:206:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
list_.py:215:4: C0200: Consider using enumerate instead of iterating with range and len (consider-using-enumerate)
list_.py:222:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
list_.py:230:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
list_.py:238:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
list_.py:272:11: W0718: Catching too general exception Exception (broad-exception-caught)
list_.py:278:11: W0718: Catching too general exception Exception (broad-exception-caught)
list_.py:288:11: W0718: Catching too general exception Exception (broad-exception-caught)
list_.py:295:4: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)
list_.py:346:11: W0718: Catching too general exception Exception (broad-exception-caught)
list_.py:363:11: W0718: Catching too general exception Exception (broad-exception-caught)
************* Module menu
menu.py:284:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:355:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:532:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens)
menu.py:536:22: C0303: Trailing whitespace (trailing-whitespace)
menu.py:599:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:603:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:612:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:619:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:623:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:631:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:706:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
menu.py:757:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:783:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:796:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:802:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:807:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:817:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:845:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:863:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:867:17: C0303: Trailing whitespace (trailing-whitespace)
menu.py:879:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:883:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:911:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:918:0: C0303: Trailing whitespace (trailing-whitespace)
menu.py:949:0: C0303: Trailing whitespace (trailing-whitespace)
🔍 MyPy 提示(点我展开)
file.py:206: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
file.py:206: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
file.py:207: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
file.py:207: 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:2131: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
menu.py:2131: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
menu.py:2140: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
menu.py:2140: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
Found 580 errors in 13 files (checked 2 source files)

@pizeroLOL

Copy link
Copy Markdown
Member

说起来那个匹配的bug修了吗

@hpdconfig/default.json直接把@hpd替换成网址的那个

@IsHPDuwu

IsHPDuwu commented Jul 1, 2025

Copy link
Copy Markdown
Member Author

说起来那个匹配的bug修了吗

@hpdconfig/default.json直接把@hpd替换成网址的那个

我懂了还要匹配一下那个 / 要不然数据库可能会匹配错

@IsHPDuwu IsHPDuwu left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

没做空值验证。

@IsHPDuwu IsHPDuwu merged commit 2fbbf77 into Class-Widgets:main Jul 3, 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.

[FEATURE]: 数据库配置

3 participants