mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-11-03 05:44:44 +08:00
refactor(runtime): clear capability callback type debt
This commit is contained in:
@@ -171,7 +171,7 @@ class CapabilityRuntime:
|
||||
raise CapabilityRuntimeClosedError("Capability Runtime 已关闭")
|
||||
|
||||
@staticmethod
|
||||
def _sync_callback(adapter: Any, name: str, *args) -> Any:
|
||||
def _sync_callback(adapter: Any, name: str, *args: Any) -> Any:
|
||||
callback = getattr(adapter, name, None)
|
||||
if not callable(callback):
|
||||
raise CapabilityAdapterContractError(f"同步 adapter 缺少 {name}()")
|
||||
@@ -186,7 +186,7 @@ class CapabilityRuntime:
|
||||
return result
|
||||
|
||||
@staticmethod
|
||||
async def _async_callback(adapter: Any, name: str, *args) -> Any:
|
||||
async def _async_callback(adapter: Any, name: str, *args: Any) -> Any:
|
||||
callback = getattr(adapter, name, None)
|
||||
if not callable(callback):
|
||||
raise CapabilityAdapterContractError(f"异步 adapter 缺少 {name}()")
|
||||
|
||||
@@ -2961,9 +2961,6 @@
|
||||
"type-arg": 3,
|
||||
"unused-coroutine": 3
|
||||
},
|
||||
"app/runtime/capabilities/runtime.py": {
|
||||
"no-untyped-def": 2
|
||||
},
|
||||
"app/runtime/compat/imports.py": {
|
||||
"assignment": 1,
|
||||
"attr-defined": 2,
|
||||
|
||||
Reference in New Issue
Block a user