ErisPulse 2.4.2.dev1__tar.gz → 2.4.3.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/PKG-INFO +21 -19
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/README.md +19 -17
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/pyproject.toml +2 -2
- erispulse-2.4.3.dev0/src/ErisPulse/CLI/commands/run.py +152 -0
- erispulse-2.4.3.dev0/src/ErisPulse/CLI/commands/run.pyi +63 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Bases/adapter.py +4 -5
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Bases/adapter.pyi +1 -1
- erispulse-2.4.3.dev0/src/ErisPulse/Core/__init__.py +47 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/adapter.py +22 -14
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/adapter.pyi +3 -7
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/config.py +3 -2
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/lifecycle.py +3 -1
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/lifecycle.pyi +0 -9
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/module.py +11 -7
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/module.pyi +3 -7
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/router.py +20 -15
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/router.pyi +1 -2
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/__init__.py +0 -12
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/__init__.pyi +1 -2
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/sdk.py +9 -67
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/sdk.pyi +2 -6
- erispulse-2.4.2.dev1/src/ErisPulse/CLI/commands/run.py +0 -252
- erispulse-2.4.2.dev1/src/ErisPulse/CLI/commands/run.pyi +0 -116
- erispulse-2.4.2.dev1/src/ErisPulse/Core/__init__.py +0 -58
- erispulse-2.4.2.dev1/src/ErisPulse/runtime/cleanup.py +0 -202
- erispulse-2.4.2.dev1/src/ErisPulse/runtime/cleanup.pyi +0 -76
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/.gitignore +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/LICENSE +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/__init__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/base.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/base.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/cli.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/cli.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/__init__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/init.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/init.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/install.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/install.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/list.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/list.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/list_remote.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/list_remote.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/self_update.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/self_update.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/uninstall.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/uninstall.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/upgrade.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/commands/upgrade.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/console.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/console.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/registry.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/registry.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/utils/__init__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/utils/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/utils/package_manager.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/CLI/utils/package_manager.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Bases/__init__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Bases/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Bases/manager.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Bases/manager.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Bases/module.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Bases/module.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/__init__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/base.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/base.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/command.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/command.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/message.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/message.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/message_builder.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/message_builder.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/meta.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/meta.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/notice.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/notice.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/request.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/request.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/session_type.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/session_type.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/wrapper.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/Event/wrapper.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/config.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/logger.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/logger.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/storage.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/Core/storage.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/__main__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/__main__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/finders/__init__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/finders/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/finders/adapter.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/finders/adapter.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/finders/bases/__init__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/finders/bases/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/finders/bases/finder.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/finders/bases/finder.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/finders/module.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/finders/module.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/__init__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/adapter.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/adapter.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/bases/__init__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/bases/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/bases/loader.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/bases/loader.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/module.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/module.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/strategy.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/loaders/strategy.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/runtime/__init__.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/runtime/__init__.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/runtime/exceptions.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/runtime/exceptions.pyi +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/runtime/frame_config.py +0 -0
- {erispulse-2.4.2.dev1 → erispulse-2.4.3.dev0}/src/ErisPulse/runtime/frame_config.pyi +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ErisPulse
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.3.dev0
|
|
4
4
|
Summary: ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
5
5
|
Author-email: ErisDev <erisdev@88.com>
|
|
6
6
|
Maintainer-email: "艾莉丝·格雷拉特(WSu2059)" <wsu2059@qq.com>
|
|
@@ -44,11 +44,11 @@ Classifier: Typing :: Typed
|
|
|
44
44
|
Requires-Python: >=3.10
|
|
45
45
|
Requires-Dist: aiohttp>=3.9.0
|
|
46
46
|
Requires-Dist: fastapi>=0.116.1
|
|
47
|
-
Requires-Dist: hypercorn>=0.14.0
|
|
48
47
|
Requires-Dist: packaging>=25.0
|
|
49
48
|
Requires-Dist: pip>=23.0
|
|
50
49
|
Requires-Dist: rich>=13.0.0
|
|
51
50
|
Requires-Dist: toml>=0.10.2
|
|
51
|
+
Requires-Dist: uvicorn>=0.30.0
|
|
52
52
|
Requires-Dist: watchdog>=4.0.0
|
|
53
53
|
Provides-Extra: dev
|
|
54
54
|
Requires-Dist: httpx>=0.24.0; extra == 'dev'
|
|
@@ -112,6 +112,25 @@ ErisPulse 是一个基于 Python 的事件驱动型多平台机器人开发框
|
|
|
112
112
|
- **热重载支持** - 开发时无需重启即可重新加载代码
|
|
113
113
|
- **完整工具链** - 提供 CLI 工具、包管理和自动化脚本
|
|
114
114
|
|
|
115
|
+
## 支持的适配器
|
|
116
|
+
|
|
117
|
+
欢迎您贡献适配器!
|
|
118
|
+
|
|
119
|
+
| 适配器 | 说明 |
|
|
120
|
+
|--------|------|
|
|
121
|
+
| <img src=".github/assets/adapter_logo/kook.svg" width="20" /> [Kook](https://github.com/shanfishapp/ErisPulse-KookAdapter) | Kook(开黑啦)即时通讯平台 |
|
|
122
|
+
| <img src=".github/assets/adapter_logo/matrix.svg" width="20" /> [Matrix](https://github.com/ErisPulse/ErisPulse-MatrixAdapter) | Matrix 去中心化通讯协议 |
|
|
123
|
+
| <img src=".github/assets/adapter_logo/onebot.png" width="20" /> [OneBot11](https://github.com/ErisPulse/ErisPulse-OneBot11Adapter) | OneBot v11 通用机器人协议 |
|
|
124
|
+
| <img src=".github/assets/adapter_logo/onebot.png" width="20" /> [OneBot12](https://github.com/ErisPulse/ErisPulse-OneBot12Adapter) | OneBot v12 标准协议 |
|
|
125
|
+
| <img src=".github/assets/adapter_logo/qqbot.svg" width="20" /> [QQ](https://github.com/ErisPulse/ErisPulse-QQBotAdapter) | QQ 官方机器人平台 |
|
|
126
|
+
| <img src=".github/assets/adapter_logo/sandbox.png" width="20" /> [沙箱](https://github.com/ErisPulse/ErisPulse-SandboxAdapter) | 网页端调试,无需接入真实平台 |
|
|
127
|
+
| <img src=".github/assets/adapter_logo/telegram.svg" width="20" /> [Telegram](https://github.com/ErisPulse/ErisPulse-TelegramAdapter) | 全球性即时通讯平台 |
|
|
128
|
+
| <img src=".github/assets/adapter_logo/email.svg" width="20" /> [邮件](https://github.com/ErisPulse/ErisPulse-EmailAdapter) | 邮件协议收发适配器 |
|
|
129
|
+
| <img src=".github/assets/adapter_logo/yunhu.png" width="20" /> [云湖](https://github.com/ErisPulse/ErisPulse-YunhuAdapter) | 企业级即时通讯平台(机器人接入) |
|
|
130
|
+
| <img src=".github/assets/adapter_logo/yunhu.png" width="20" /> [云湖用户](https://github.com/wsu2059q/ErisPulse-YunhuUserAdapter) | 基于云湖用户协议的接入适配器 |
|
|
131
|
+
|
|
132
|
+
查看 [适配器详情介绍](docs/zh-CN/platform-guide/README.md)
|
|
133
|
+
|
|
115
134
|
## 快速开始
|
|
116
135
|
|
|
117
136
|
### 使用 Docker (推荐)
|
|
@@ -231,23 +250,6 @@ epsdk run main.py --reload
|
|
|
231
250
|
- **自动化工具** - 消息通知、任务管理、数据收集
|
|
232
251
|
- **消息转发** - 跨平台消息同步和转发
|
|
233
252
|
|
|
234
|
-
## 支持的适配器
|
|
235
|
-
|
|
236
|
-
欢迎您贡献适配器!
|
|
237
|
-
|
|
238
|
-
| 适配器 | 说明 |
|
|
239
|
-
|--------|------|
|
|
240
|
-
| [云湖](https://github.com/ErisPulse/ErisPulse-YunhuAdapter) | 企业级即时通讯平台(机器人账户) |
|
|
241
|
-
| [云湖用户](https://github.com/wsu2059q/ErisPulse-YunhuUserAdapter) | 基于云湖用户账户的适配器 |
|
|
242
|
-
| [Telegram](https://github.com/ErisPulse/ErisPulse-TelegramAdapter) | 全球性即时通讯软件 |
|
|
243
|
-
| [OneBot11](https://github.com/ErisPulse/ErisPulse-OneBot11Adapter) | 通用机器人接口标准 |
|
|
244
|
-
| [OneBot12](https://github.com/ErisPulse/ErisPulse-OneBot12Adapter) | OneBot12 标准 |
|
|
245
|
-
| [邮件](https://github.com/ErisPulse/ErisPulse-EmailAdapter) | 邮件收发处理 |
|
|
246
|
-
| [沙箱](https://github.com/ErisPulse/ErisPulse-SandboxAdapter) | 网页调试界面,无需接入实际平台 |
|
|
247
|
-
| [Kook](https://github.com/shanfishapp/ErisPulse-KookAdapter) | Kook(开黑啦)即时通讯平台 |
|
|
248
|
-
|
|
249
|
-
查看 [适配器详情介绍](docs/zh-CN/platform-guide/README.md)
|
|
250
|
-
|
|
251
253
|
## 文档资源
|
|
252
254
|
|
|
253
255
|
| 简体中文 | English | 繁體中文 |
|
|
@@ -40,6 +40,25 @@ ErisPulse 是一个基于 Python 的事件驱动型多平台机器人开发框
|
|
|
40
40
|
- **热重载支持** - 开发时无需重启即可重新加载代码
|
|
41
41
|
- **完整工具链** - 提供 CLI 工具、包管理和自动化脚本
|
|
42
42
|
|
|
43
|
+
## 支持的适配器
|
|
44
|
+
|
|
45
|
+
欢迎您贡献适配器!
|
|
46
|
+
|
|
47
|
+
| 适配器 | 说明 |
|
|
48
|
+
|--------|------|
|
|
49
|
+
| <img src=".github/assets/adapter_logo/kook.svg" width="20" /> [Kook](https://github.com/shanfishapp/ErisPulse-KookAdapter) | Kook(开黑啦)即时通讯平台 |
|
|
50
|
+
| <img src=".github/assets/adapter_logo/matrix.svg" width="20" /> [Matrix](https://github.com/ErisPulse/ErisPulse-MatrixAdapter) | Matrix 去中心化通讯协议 |
|
|
51
|
+
| <img src=".github/assets/adapter_logo/onebot.png" width="20" /> [OneBot11](https://github.com/ErisPulse/ErisPulse-OneBot11Adapter) | OneBot v11 通用机器人协议 |
|
|
52
|
+
| <img src=".github/assets/adapter_logo/onebot.png" width="20" /> [OneBot12](https://github.com/ErisPulse/ErisPulse-OneBot12Adapter) | OneBot v12 标准协议 |
|
|
53
|
+
| <img src=".github/assets/adapter_logo/qqbot.svg" width="20" /> [QQ](https://github.com/ErisPulse/ErisPulse-QQBotAdapter) | QQ 官方机器人平台 |
|
|
54
|
+
| <img src=".github/assets/adapter_logo/sandbox.png" width="20" /> [沙箱](https://github.com/ErisPulse/ErisPulse-SandboxAdapter) | 网页端调试,无需接入真实平台 |
|
|
55
|
+
| <img src=".github/assets/adapter_logo/telegram.svg" width="20" /> [Telegram](https://github.com/ErisPulse/ErisPulse-TelegramAdapter) | 全球性即时通讯平台 |
|
|
56
|
+
| <img src=".github/assets/adapter_logo/email.svg" width="20" /> [邮件](https://github.com/ErisPulse/ErisPulse-EmailAdapter) | 邮件协议收发适配器 |
|
|
57
|
+
| <img src=".github/assets/adapter_logo/yunhu.png" width="20" /> [云湖](https://github.com/ErisPulse/ErisPulse-YunhuAdapter) | 企业级即时通讯平台(机器人接入) |
|
|
58
|
+
| <img src=".github/assets/adapter_logo/yunhu.png" width="20" /> [云湖用户](https://github.com/wsu2059q/ErisPulse-YunhuUserAdapter) | 基于云湖用户协议的接入适配器 |
|
|
59
|
+
|
|
60
|
+
查看 [适配器详情介绍](docs/zh-CN/platform-guide/README.md)
|
|
61
|
+
|
|
43
62
|
## 快速开始
|
|
44
63
|
|
|
45
64
|
### 使用 Docker (推荐)
|
|
@@ -159,23 +178,6 @@ epsdk run main.py --reload
|
|
|
159
178
|
- **自动化工具** - 消息通知、任务管理、数据收集
|
|
160
179
|
- **消息转发** - 跨平台消息同步和转发
|
|
161
180
|
|
|
162
|
-
## 支持的适配器
|
|
163
|
-
|
|
164
|
-
欢迎您贡献适配器!
|
|
165
|
-
|
|
166
|
-
| 适配器 | 说明 |
|
|
167
|
-
|--------|------|
|
|
168
|
-
| [云湖](https://github.com/ErisPulse/ErisPulse-YunhuAdapter) | 企业级即时通讯平台(机器人账户) |
|
|
169
|
-
| [云湖用户](https://github.com/wsu2059q/ErisPulse-YunhuUserAdapter) | 基于云湖用户账户的适配器 |
|
|
170
|
-
| [Telegram](https://github.com/ErisPulse/ErisPulse-TelegramAdapter) | 全球性即时通讯软件 |
|
|
171
|
-
| [OneBot11](https://github.com/ErisPulse/ErisPulse-OneBot11Adapter) | 通用机器人接口标准 |
|
|
172
|
-
| [OneBot12](https://github.com/ErisPulse/ErisPulse-OneBot12Adapter) | OneBot12 标准 |
|
|
173
|
-
| [邮件](https://github.com/ErisPulse/ErisPulse-EmailAdapter) | 邮件收发处理 |
|
|
174
|
-
| [沙箱](https://github.com/ErisPulse/ErisPulse-SandboxAdapter) | 网页调试界面,无需接入实际平台 |
|
|
175
|
-
| [Kook](https://github.com/shanfishapp/ErisPulse-KookAdapter) | Kook(开黑啦)即时通讯平台 |
|
|
176
|
-
|
|
177
|
-
查看 [适配器详情介绍](docs/zh-CN/platform-guide/README.md)
|
|
178
|
-
|
|
179
181
|
## 文档资源
|
|
180
182
|
|
|
181
183
|
| 简体中文 | English | 繁體中文 |
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ErisPulse"
|
|
7
|
-
version = "2.4.
|
|
7
|
+
version = "2.4.3-dev.0"
|
|
8
8
|
description = "ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -55,7 +55,7 @@ dependencies = [
|
|
|
55
55
|
"watchdog>=4.0.0",
|
|
56
56
|
"toml>=0.10.2",
|
|
57
57
|
"fastapi>=0.116.1",
|
|
58
|
-
"
|
|
58
|
+
"uvicorn>=0.30.0",
|
|
59
59
|
"packaging>=25.0",
|
|
60
60
|
]
|
|
61
61
|
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Run 命令实现
|
|
3
|
+
|
|
4
|
+
直接运行主程序,支持热重载模式
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
import time
|
|
9
|
+
import asyncio
|
|
10
|
+
from argparse import ArgumentParser
|
|
11
|
+
from watchdog.observers import Observer
|
|
12
|
+
from rich.panel import Panel
|
|
13
|
+
from watchdog.events import FileSystemEventHandler
|
|
14
|
+
|
|
15
|
+
from ..console import console
|
|
16
|
+
from ..base import Command
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ReloadHandler(FileSystemEventHandler):
|
|
20
|
+
"""
|
|
21
|
+
文件系统事件处理器
|
|
22
|
+
|
|
23
|
+
监控 .py 文件变更并触发 sdk.restart() 热重载
|
|
24
|
+
|
|
25
|
+
{!--< tips >!--}
|
|
26
|
+
1. 文件监控运行在独立线程
|
|
27
|
+
2. 通过 run_coroutine_threadsafe 安全调度到事件循环
|
|
28
|
+
3. 内置 1 秒防抖,避免短时间内多次重载
|
|
29
|
+
{!--< /tips >!--}
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
def __init__(self, loop: asyncio.AbstractEventLoop):
|
|
33
|
+
super().__init__()
|
|
34
|
+
self._loop = loop
|
|
35
|
+
self._last_reload = 0.0
|
|
36
|
+
|
|
37
|
+
def on_modified(self, event):
|
|
38
|
+
now = time.time()
|
|
39
|
+
if now - self._last_reload < 1.0:
|
|
40
|
+
return
|
|
41
|
+
if event.src_path.endswith(".py"):
|
|
42
|
+
self._last_reload = now
|
|
43
|
+
self._schedule_reload(event)
|
|
44
|
+
|
|
45
|
+
def _schedule_reload(self, event):
|
|
46
|
+
async def _do_reload():
|
|
47
|
+
try:
|
|
48
|
+
from ... import sdk
|
|
49
|
+
await sdk.restart()
|
|
50
|
+
except Exception as e:
|
|
51
|
+
console.print(f"[error]热重载失败: {e}[/]")
|
|
52
|
+
|
|
53
|
+
console.print(f"检测到文件变更 ({os.path.basename(event.src_path)}),正在热重载...")
|
|
54
|
+
asyncio.run_coroutine_threadsafe(_do_reload(), self._loop)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class RunCommand(Command):
|
|
58
|
+
"""
|
|
59
|
+
Run 命令
|
|
60
|
+
|
|
61
|
+
运行主程序,支持热重载模式
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
name = "run"
|
|
65
|
+
description = "运行主程序"
|
|
66
|
+
|
|
67
|
+
def add_arguments(self, parser: ArgumentParser):
|
|
68
|
+
parser.add_argument(
|
|
69
|
+
'script',
|
|
70
|
+
nargs='?',
|
|
71
|
+
default=None,
|
|
72
|
+
help='要运行的主程序路径 (不指定则直接运行 SDK)'
|
|
73
|
+
)
|
|
74
|
+
parser.add_argument(
|
|
75
|
+
'--reload',
|
|
76
|
+
action='store_true',
|
|
77
|
+
default=False,
|
|
78
|
+
help='启用热重载模式'
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
def execute(self, args):
|
|
82
|
+
script = args.script
|
|
83
|
+
reload_mode = args.reload
|
|
84
|
+
|
|
85
|
+
if script:
|
|
86
|
+
if not os.path.exists(script):
|
|
87
|
+
console.print(f"[error]脚本 [path]{script}[/] 不存在[/]")
|
|
88
|
+
console.print("[info]使用 [cyan]epsdk init[/cyan] 创建新项目[/]")
|
|
89
|
+
return
|
|
90
|
+
self._run_script(script, reload_mode)
|
|
91
|
+
else:
|
|
92
|
+
self._run_internal(reload_mode)
|
|
93
|
+
|
|
94
|
+
def _run_internal(self, reload_mode: bool):
|
|
95
|
+
"""
|
|
96
|
+
直接运行 SDK(不指定脚本时)
|
|
97
|
+
"""
|
|
98
|
+
async def _run():
|
|
99
|
+
from ... import sdk
|
|
100
|
+
|
|
101
|
+
if reload_mode:
|
|
102
|
+
loop = asyncio.get_running_loop()
|
|
103
|
+
self._setup_watchdog(".", loop)
|
|
104
|
+
|
|
105
|
+
await sdk.run(keep_running=True)
|
|
106
|
+
|
|
107
|
+
try:
|
|
108
|
+
asyncio.run(_run())
|
|
109
|
+
except KeyboardInterrupt:
|
|
110
|
+
pass
|
|
111
|
+
finally:
|
|
112
|
+
if reload_mode and hasattr(self, '_observer'):
|
|
113
|
+
self._observer.stop()
|
|
114
|
+
self._observer.join()
|
|
115
|
+
|
|
116
|
+
def _run_script(self, script_path: str, reload_mode: bool):
|
|
117
|
+
"""
|
|
118
|
+
运行指定脚本文件
|
|
119
|
+
"""
|
|
120
|
+
async def _run():
|
|
121
|
+
from ... import sdk
|
|
122
|
+
|
|
123
|
+
if reload_mode:
|
|
124
|
+
loop = asyncio.get_running_loop()
|
|
125
|
+
watch_dir = os.path.dirname(os.path.abspath(script_path))
|
|
126
|
+
self._setup_watchdog(watch_dir, loop)
|
|
127
|
+
|
|
128
|
+
await sdk.run(keep_running=True)
|
|
129
|
+
|
|
130
|
+
try:
|
|
131
|
+
asyncio.run(_run())
|
|
132
|
+
except KeyboardInterrupt:
|
|
133
|
+
pass
|
|
134
|
+
finally:
|
|
135
|
+
if reload_mode and hasattr(self, '_observer'):
|
|
136
|
+
self._observer.stop()
|
|
137
|
+
self._observer.join()
|
|
138
|
+
|
|
139
|
+
def _setup_watchdog(self, watch_dir: str, loop: asyncio.AbstractEventLoop):
|
|
140
|
+
if not os.path.exists(watch_dir):
|
|
141
|
+
return
|
|
142
|
+
|
|
143
|
+
self._observer = Observer()
|
|
144
|
+
self._handler = ReloadHandler(loop=loop)
|
|
145
|
+
self._observer.schedule(self._handler, watch_dir, recursive=True)
|
|
146
|
+
self._observer.start()
|
|
147
|
+
|
|
148
|
+
console.print(Panel(
|
|
149
|
+
f"[bold]开发重载模式[/]\n监控目录: [path]{watch_dir}[/]",
|
|
150
|
+
title="热重载已启动",
|
|
151
|
+
border_style="info"
|
|
152
|
+
))
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# type: ignore
|
|
2
|
+
#
|
|
3
|
+
# Auto-generated type stub for run.py
|
|
4
|
+
# DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
Run 命令实现
|
|
9
|
+
|
|
10
|
+
直接运行主程序,支持热重载模式
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import os
|
|
14
|
+
import time
|
|
15
|
+
import asyncio
|
|
16
|
+
from argparse import ArgumentParser
|
|
17
|
+
from watchdog.observers import Observer
|
|
18
|
+
from rich.panel import Panel
|
|
19
|
+
from watchdog.events import FileSystemEventHandler
|
|
20
|
+
from ..console import console
|
|
21
|
+
from ..base import Command
|
|
22
|
+
|
|
23
|
+
class ReloadHandler(FileSystemEventHandler):
|
|
24
|
+
"""
|
|
25
|
+
文件系统事件处理器
|
|
26
|
+
|
|
27
|
+
监控 .py 文件变更并触发 sdk.restart() 热重载
|
|
28
|
+
|
|
29
|
+
{!--< tips >!--}
|
|
30
|
+
1. 文件监控运行在独立线程
|
|
31
|
+
2. 通过 run_coroutine_threadsafe 安全调度到事件循环
|
|
32
|
+
3. 内置 1 秒防抖,避免短时间内多次重载
|
|
33
|
+
{!--< /tips >!--}
|
|
34
|
+
"""
|
|
35
|
+
def __init__(self: None, loop: asyncio.AbstractEventLoop) -> ...:
|
|
36
|
+
...
|
|
37
|
+
def on_modified(self: object, event: ...) -> ...:
|
|
38
|
+
...
|
|
39
|
+
def _schedule_reload(self: object, event: ...) -> ...:
|
|
40
|
+
...
|
|
41
|
+
|
|
42
|
+
class RunCommand(Command):
|
|
43
|
+
"""
|
|
44
|
+
Run 命令
|
|
45
|
+
|
|
46
|
+
运行主程序,支持热重载模式
|
|
47
|
+
"""
|
|
48
|
+
def add_arguments(self: object, parser: ArgumentParser) -> ...:
|
|
49
|
+
...
|
|
50
|
+
def execute(self: object, args: ...) -> ...:
|
|
51
|
+
...
|
|
52
|
+
def _run_internal(self: object, reload_mode: bool) -> ...:
|
|
53
|
+
"""
|
|
54
|
+
直接运行 SDK(不指定脚本时)
|
|
55
|
+
"""
|
|
56
|
+
...
|
|
57
|
+
def _run_script(self: object, script_path: str, reload_mode: bool) -> ...:
|
|
58
|
+
"""
|
|
59
|
+
运行指定脚本文件
|
|
60
|
+
"""
|
|
61
|
+
...
|
|
62
|
+
def _setup_watchdog(self: object, watch_dir: str, loop: asyncio.AbstractEventLoop) -> ...:
|
|
63
|
+
...
|
|
@@ -341,11 +341,10 @@ class BaseAdapter(ABC):
|
|
|
341
341
|
"""
|
|
342
342
|
raise NotImplementedError("适配器必须实现shutdown方法")
|
|
343
343
|
|
|
344
|
-
async def emit(self
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
"适配器调用了一个被弃用的原生方法emit,请检查适配器的实现,如果你是开发者请查看ErisPulse的文档进行更新。如果你是普通用户请查看本适配器是否有更新"
|
|
344
|
+
async def emit(self, *args, **kwargs):
|
|
345
|
+
raise NotImplementedError(
|
|
346
|
+
"适配器的 emit 方法已被弃用。请使用 adapter.emit() 通过 AdapterManager 提交事件。"
|
|
347
|
+
"如果你是适配器开发者,请查看 ErisPulse 文档进行更新。"
|
|
349
348
|
)
|
|
350
349
|
|
|
351
350
|
def send(
|
|
@@ -158,7 +158,7 @@ class BaseAdapter(ABC):
|
|
|
158
158
|
:raises NotImplementedError: 必须由子类实现
|
|
159
159
|
"""
|
|
160
160
|
...
|
|
161
|
-
async def emit(self: object) ->
|
|
161
|
+
async def emit(self: object, *args: ..., **kwargs: ...) -> ...:
|
|
162
162
|
...
|
|
163
163
|
def send(self: object, target_type: str, target_id: str, message: Any, **kwargs: Any) -> asyncio.Task:
|
|
164
164
|
"""
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ErisPulse 核心模块
|
|
3
|
+
|
|
4
|
+
提供了一系列用于构建和管理应用的核心组件,包括适配器、模块、存储、配置、路由和生命周期管理等。
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .lifecycle import lifecycle, LifecycleManager
|
|
8
|
+
from .adapter import adapter, AdapterManager
|
|
9
|
+
from .Bases import BaseAdapter, BaseModule, SendDSL
|
|
10
|
+
from .storage import storage, StorageManager
|
|
11
|
+
from .logger import logger, Logger, LoggerChild
|
|
12
|
+
from .module import module, ModuleManager
|
|
13
|
+
from .router import router, RouterManager
|
|
14
|
+
from .config import config, ConfigManager
|
|
15
|
+
from . import Event
|
|
16
|
+
from .Event.message_builder import MessageBuilder
|
|
17
|
+
|
|
18
|
+
env = storage # 存储管理器别名
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
'Event',
|
|
22
|
+
|
|
23
|
+
'adapter',
|
|
24
|
+
'AdapterManager',
|
|
25
|
+
'BaseAdapter',
|
|
26
|
+
'SendDSL',
|
|
27
|
+
'MessageBuilder',
|
|
28
|
+
|
|
29
|
+
'module',
|
|
30
|
+
'ModuleManager',
|
|
31
|
+
'BaseModule',
|
|
32
|
+
|
|
33
|
+
'storage',
|
|
34
|
+
'StorageManager',
|
|
35
|
+
'config',
|
|
36
|
+
'env', # 配置管理器别名
|
|
37
|
+
'ConfigManager',
|
|
38
|
+
|
|
39
|
+
'router',
|
|
40
|
+
'RouterManager',
|
|
41
|
+
|
|
42
|
+
'logger',
|
|
43
|
+
'Logger',
|
|
44
|
+
'LoggerChild',
|
|
45
|
+
'lifecycle',
|
|
46
|
+
'LifecycleManager',
|
|
47
|
+
]
|
|
@@ -8,6 +8,7 @@ import functools
|
|
|
8
8
|
import asyncio
|
|
9
9
|
import inspect
|
|
10
10
|
import time
|
|
11
|
+
import warnings
|
|
11
12
|
from typing import Any
|
|
12
13
|
from collections.abc import Callable
|
|
13
14
|
from collections import defaultdict
|
|
@@ -586,13 +587,11 @@ class AdapterManager(ManagerBase):
|
|
|
586
587
|
|
|
587
588
|
# 兼容性方法 - 保持向后兼容
|
|
588
589
|
def list_adapters(self) -> dict[str, bool]:
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
:return: [dict[str, bool]] 平台适配器状态字典
|
|
595
|
-
"""
|
|
590
|
+
warnings.warn(
|
|
591
|
+
"list_adapters() 已弃用,请使用 list_items() 代替",
|
|
592
|
+
DeprecationWarning,
|
|
593
|
+
stacklevel=2,
|
|
594
|
+
)
|
|
596
595
|
return self.list_items()
|
|
597
596
|
|
|
598
597
|
# ==================== 事件处理与消息发送 ====================
|
|
@@ -851,15 +850,19 @@ class AdapterManager(ManagerBase):
|
|
|
851
850
|
)
|
|
852
851
|
|
|
853
852
|
if status == "offline":
|
|
854
|
-
# 只有在非主动关闭的情况下才提交事件(避免与 shutdown() 重复)
|
|
855
853
|
if not self._is_being_shutdown:
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
854
|
+
try:
|
|
855
|
+
loop = asyncio.get_running_loop()
|
|
856
|
+
task = loop.create_task(
|
|
857
|
+
lifecycle.submit_event(
|
|
858
|
+
"adapter.bot.offline",
|
|
859
|
+
msg=f"Bot {platform}/{bot_id} 离线",
|
|
860
|
+
data={"platform": platform, "bot_id": bot_id, "status": "offline"},
|
|
861
|
+
)
|
|
861
862
|
)
|
|
862
|
-
|
|
863
|
+
self._adapter_tasks.setdefault(f"_bot_offline_{platform}_{bot_id}", task)
|
|
864
|
+
except RuntimeError:
|
|
865
|
+
pass
|
|
863
866
|
|
|
864
867
|
def _update_bot_heartbeat(self, platform: str, self_info: dict) -> None:
|
|
865
868
|
"""
|
|
@@ -1171,6 +1174,11 @@ class AdapterManager(ManagerBase):
|
|
|
1171
1174
|
"""
|
|
1172
1175
|
return self.exists(platform) and self.is_enabled(platform)
|
|
1173
1176
|
|
|
1177
|
+
def __repr__(self) -> str:
|
|
1178
|
+
registered = list(self._adapters.keys())
|
|
1179
|
+
running = [p for p, a in self._adapters.items() if a in self._started_instances]
|
|
1180
|
+
return f"<AdapterManager registered={registered} running={running}>"
|
|
1181
|
+
|
|
1174
1182
|
|
|
1175
1183
|
adapter: AdapterManager = AdapterManager()
|
|
1176
1184
|
|
|
@@ -14,6 +14,7 @@ import functools
|
|
|
14
14
|
import asyncio
|
|
15
15
|
import inspect
|
|
16
16
|
import time
|
|
17
|
+
import warnings
|
|
17
18
|
from typing import Any
|
|
18
19
|
from collections.abc import Callable
|
|
19
20
|
from collections import defaultdict
|
|
@@ -157,13 +158,6 @@ class AdapterManager(ManagerBase):
|
|
|
157
158
|
"""
|
|
158
159
|
...
|
|
159
160
|
def list_adapters(self: object) -> dict[(str, bool)]:
|
|
160
|
-
"""
|
|
161
|
-
列出所有平台适配器状态
|
|
162
|
-
|
|
163
|
-
{!--< deprecated >!--} 请使用 list_items() 代替
|
|
164
|
-
|
|
165
|
-
:return: [dict[str, bool]] 平台适配器状态字典
|
|
166
|
-
"""
|
|
167
161
|
...
|
|
168
162
|
def on(self: object, event_type: str = ...) -> Callable[([Callable], Callable)]:
|
|
169
163
|
"""
|
|
@@ -391,5 +385,7 @@ class AdapterManager(ManagerBase):
|
|
|
391
385
|
:return: [bool] 平台是否存在且启用
|
|
392
386
|
"""
|
|
393
387
|
...
|
|
388
|
+
def __repr__(self: object) -> str:
|
|
389
|
+
...
|
|
394
390
|
|
|
395
391
|
adapter: AdapterManager
|
|
@@ -77,15 +77,6 @@ class LifecycleManager:
|
|
|
77
77
|
"""
|
|
78
78
|
...
|
|
79
79
|
async def submit_event(self: object, event_type: str) -> None:
|
|
80
|
-
"""
|
|
81
|
-
提交生命周期事件
|
|
82
|
-
|
|
83
|
-
:param event_type: 事件名称
|
|
84
|
-
:param source: 事件来源(默认"ErisPulse")
|
|
85
|
-
:param msg: 事件描述
|
|
86
|
-
:param data: 事件相关数据
|
|
87
|
-
:param timestamp: 时间戳(默认当前时间)
|
|
88
|
-
"""
|
|
89
80
|
...
|
|
90
81
|
async def _execute_handlers(self: object, event: str, event_data: dict[(str, Any)]) -> None:
|
|
91
82
|
"""
|
|
@@ -5,6 +5,7 @@ ErisPulse 模块系统
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import inspect
|
|
8
|
+
import warnings
|
|
8
9
|
from typing import Any
|
|
9
10
|
from .logger import logger
|
|
10
11
|
from .config import config
|
|
@@ -530,13 +531,11 @@ class ModuleManager(ManagerBase):
|
|
|
530
531
|
|
|
531
532
|
# 兼容性方法 - 保持向后兼容
|
|
532
533
|
def list_modules(self) -> dict[str, bool]:
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
:return: [dict[str, bool]] 模块状态字典
|
|
539
|
-
"""
|
|
534
|
+
warnings.warn(
|
|
535
|
+
"list_modules() 已弃用,请使用 list_items() 代替",
|
|
536
|
+
DeprecationWarning,
|
|
537
|
+
stacklevel=2,
|
|
538
|
+
)
|
|
540
539
|
return self.list_items()
|
|
541
540
|
|
|
542
541
|
# ==================== 工具方法 ====================
|
|
@@ -568,6 +567,11 @@ class ModuleManager(ManagerBase):
|
|
|
568
567
|
"""
|
|
569
568
|
return self.exists(module_name) and self.is_enabled(module_name)
|
|
570
569
|
|
|
570
|
+
def __repr__(self) -> str:
|
|
571
|
+
registered = list(self._module_classes.keys())
|
|
572
|
+
loaded = list(self._loaded_modules)
|
|
573
|
+
return f"<ModuleManager registered={registered} loaded={loaded}>"
|
|
574
|
+
|
|
571
575
|
|
|
572
576
|
module: ModuleManager = ModuleManager()
|
|
573
577
|
|
|
@@ -11,6 +11,7 @@ ErisPulse 模块系统
|
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
13
|
import inspect
|
|
14
|
+
import warnings
|
|
14
15
|
from typing import Any
|
|
15
16
|
from .logger import logger
|
|
16
17
|
from .config import config
|
|
@@ -228,13 +229,6 @@ class ModuleManager(ManagerBase):
|
|
|
228
229
|
"""
|
|
229
230
|
...
|
|
230
231
|
def list_modules(self: object) -> dict[(str, bool)]:
|
|
231
|
-
"""
|
|
232
|
-
列出所有模块状态
|
|
233
|
-
|
|
234
|
-
{!--< deprecated >!--} 请使用 list_items() 代替
|
|
235
|
-
|
|
236
|
-
:return: [dict[str, bool]] 模块状态字典
|
|
237
|
-
"""
|
|
238
232
|
...
|
|
239
233
|
def __getattr__(self: object, module_name: str) -> Any:
|
|
240
234
|
"""
|
|
@@ -259,5 +253,7 @@ class ModuleManager(ManagerBase):
|
|
|
259
253
|
>>> if "MyModule" in module: ...
|
|
260
254
|
"""
|
|
261
255
|
...
|
|
256
|
+
def __repr__(self: object) -> str:
|
|
257
|
+
...
|
|
262
258
|
|
|
263
259
|
module: ModuleManager
|