Skip to content

feat: 开一些集控相关的洞#4

Open
IsHPDuwu wants to merge 1 commit into
masterfrom
feat/holes_for_cc
Open

feat: 开一些集控相关的洞#4
IsHPDuwu wants to merge 1 commit into
masterfrom
feat/holes_for_cc

Conversation

@IsHPDuwu

@IsHPDuwu IsHPDuwu commented Jul 17, 2026

Copy link
Copy Markdown
Member

别忘了 bump ))

Comment thread ClassWidgets/SDK/api.pyi
Comment on lines +118 to +123
def list_schedules(self) -> List[Dict[str, str]]: ...

def set_schedule_readonly(self, readonly: bool) -> None: ...
@property
def schedule_readonly(self) -> bool: ...

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.

R118到R123 这部分不太优雅,可以考虑优化为:

    def set_readonly(self, readonly: bool) -> None: ...  # 以及最好返回结果(ps之前的也帮忙顺便改吧)

    @property
    def readonly(self) -> bool: ...

并且由于 ScheduleAPI 这个类名本身已经是单数,并且目前其方法也是对单个正在使用的课程表文件的修改。在这里增加的 list_schedulesswitch 方法我认为算是违反单一职责的;我推荐可以开个新的API类来专门管理多个课程表

Comment thread ClassWidgets/SDK/api.pyi
Comment on lines +197 to +198
def get_global(self, key: str, default: Any = ...) -> Any: ...
def set_global(self, key: str, value: Any) -> None: ...

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.

同上,方法命名不简洁。推荐改为 get()set() ,这个global若是指向的全局设置,那我觉得不加反而更好。

Comment thread ClassWidgets/SDK/api.pyi
Comment on lines +200 to +201
def lock_config_keys(self, keys: List[str]) -> None: ...
def unlock_config_keys(self, keys: List[str]) -> None: ...

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.

也同上,这个 config 是不是多余了?

Comment thread ClassWidgets/SDK/api.pyi
Comment on lines +199 to +204

def lock_config_keys(self, keys: List[str]) -> None: ...
def unlock_config_keys(self, keys: List[str]) -> None: ...
def is_key_locked(self, key: str) -> bool: ...
@property
def locked_keys(self) -> List[str]: ...

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.

并且对于这些无法一眼通过方法名就能了解的函数,我希望可以增加 docstring 通过文字注解补充含义,也能方便后期的文档制作。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants