23 lines
411 B
Python
23 lines
411 B
Python
"""插件基础类"""
|
|
from abc import ABC, abstractmethod
|
|
from typing import Any, Optional
|
|
|
|
|
|
class Plugin(ABC):
|
|
"""插件基类"""
|
|
|
|
@abstractmethod
|
|
def init(self, deps: Optional[dict] = None):
|
|
"""初始化插件"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def start(self):
|
|
"""启动插件"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def stop(self):
|
|
"""停止插件"""
|
|
pass
|