feat(desktop-wake): add WeCom UIA warm-tree and ship n2-wake in 1.2.3
All checks were successful
Publish Python Package to Gitea / publish (push) Successful in 29s
All checks were successful
Publish Python Package to Gitea / publish (push) Successful in 29s
Expose ensure_ui_ready via DuiLib GetAccessible inject path; package x86 native helpers for host/skill consumers. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
30
src/jiangchang_desktop_wake/errors.py
Normal file
30
src/jiangchang_desktop_wake/errors.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""桌面 Provider 暖树错误码(stdout / 异常消息前缀)。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
ERR_WINDOW_NOT_FOUND = "ERROR:WINDOW_NOT_FOUND"
|
||||
ERR_UIA_UNAVAILABLE = "ERROR:UIA_UNAVAILABLE"
|
||||
ERR_PROVIDER_COLD = "ERROR:PROVIDER_COLD"
|
||||
ERR_WAKE_FAILED = "ERROR:WAKE_FAILED"
|
||||
ERR_UNSUPPORTED_OS = "ERROR:UNSUPPORTED_OS"
|
||||
ERR_PROFILE_NOT_FOUND = "ERROR:PROFILE_NOT_FOUND"
|
||||
|
||||
__all__ = [
|
||||
"ERR_WINDOW_NOT_FOUND",
|
||||
"ERR_UIA_UNAVAILABLE",
|
||||
"ERR_PROVIDER_COLD",
|
||||
"ERR_WAKE_FAILED",
|
||||
"ERR_UNSUPPORTED_OS",
|
||||
"ERR_PROFILE_NOT_FOUND",
|
||||
"DesktopWakeError",
|
||||
]
|
||||
|
||||
|
||||
class DesktopWakeError(RuntimeError):
|
||||
"""暖树失败;``code`` 为稳定错误码(无 ERROR: 前缀)。"""
|
||||
|
||||
def __init__(self, code: str, message: str):
|
||||
self.code = code
|
||||
self.message = message
|
||||
prefix = code if code.startswith("ERROR:") else f"ERROR:{code}"
|
||||
super().__init__(f"{prefix}: {message}")
|
||||
Reference in New Issue
Block a user