-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Expand file tree
/
Copy path__init__.py
More file actions
29 lines (22 loc) · 903 Bytes
/
Copy path__init__.py
File metadata and controls
29 lines (22 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 模块依赖关系如下:
# 被依赖方 <--- 使用方
# config <--- entity <--- toolkit <--- client <--- option <--- downloader
__version__ = '2.6.10'
from .api import *
from .jm_plugin import *
# 下面进行注册组件(客户端、插件)
gb = dict(filter(lambda pair: isinstance(pair[1], type), globals().items()))
def register_jmcomic_component(variables: Dict[str, Any], method, valid_interface: type):
for v in variables.values():
if v != valid_interface and issubclass(v, valid_interface):
method(v)
# 注册客户端
register_jmcomic_component(gb,
JmModuleConfig.register_client,
JmcomicClient,
)
# 注册插件
register_jmcomic_component(gb,
JmModuleConfig.register_plugin,
JmOptionPlugin,
)