2023-02-15 19:29:00 +08:00

47 lines
994 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from abc import ABCMeta, abstractmethod
class _IPluginModule(metaclass=ABCMeta):
"""
插件模块基类
"""
# 插件名称
module_name = ""
# 插件描述
module_desc = ""
# 插件图标
module_icon = ""
# 主题色
module_color = ""
# 插件版本
module_version = "1.0"
# 插件作者
module_author = ""
# 插件配置项ID前缀为了避免各插件配置表单相冲突配置表单元素ID自动在前面加上此前缀
module_config_prefix = "plugin_"
# 显示顺序
module_order = 0
@staticmethod
@abstractmethod
def get_fields():
"""
获取配置字典,用于生成表单
"""
pass
@abstractmethod
def init_config(self, config: dict):
"""
生效配置信息
:param config: 配置信息字典
"""
pass
@abstractmethod
def stop_service(self):
"""
停止插件
"""
pass