mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-28 03:27:31 +08:00
fix actions
This commit is contained in:
+13
-10
@@ -16,28 +16,24 @@ class BaseAction(ABC):
|
||||
# 完成标志
|
||||
_done_flag = False
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@abstractmethod
|
||||
def name(self) -> str:
|
||||
def name(cls) -> str:
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@abstractmethod
|
||||
def description(self) -> str:
|
||||
def description(cls) -> str:
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@abstractmethod
|
||||
def data(self) -> dict:
|
||||
def data(cls) -> dict:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def execute(self, params: ActionParams, context: ActionContext) -> ActionContext:
|
||||
"""
|
||||
执行动作
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def done(self) -> bool:
|
||||
"""
|
||||
@@ -58,3 +54,10 @@ class BaseAction(ABC):
|
||||
标记动作完成
|
||||
"""
|
||||
self._done_flag = True
|
||||
|
||||
@abstractmethod
|
||||
def execute(self, params: ActionParams, context: ActionContext) -> ActionContext:
|
||||
"""
|
||||
执行动作
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user