ErisPulse 1.0.12__py3-none-any.whl → 1.0.14.dev1__py3-none-any.whl
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/__init__.py +146 -139
- ErisPulse/__main__.py +694 -931
- ErisPulse/{envManager.py → db.py} +227 -227
- ErisPulse/logger.py +123 -48
- ErisPulse/raiserr.py +44 -0
- ErisPulse/util.py +1 -3
- {erispulse-1.0.12.dist-info → erispulse-1.0.14.dev1.dist-info}/METADATA +73 -96
- erispulse-1.0.14.dev1.dist-info/RECORD +11 -0
- {erispulse-1.0.12.dist-info → erispulse-1.0.14.dev1.dist-info}/WHEEL +1 -1
- ErisPulse/errors.py +0 -16
- erispulse-1.0.12.dist-info/RECORD +0 -11
- {erispulse-1.0.12.dist-info → erispulse-1.0.14.dev1.dist-info}/entry_points.txt +0 -0
- {erispulse-1.0.12.dist-info → erispulse-1.0.14.dev1.dist-info}/top_level.txt +0 -0
ErisPulse/raiserr.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import traceback
|
|
3
|
+
|
|
4
|
+
class Error:
|
|
5
|
+
def __init__(self):
|
|
6
|
+
self._types = {}
|
|
7
|
+
|
|
8
|
+
def register(self, name, doc="", base=Exception):
|
|
9
|
+
if name not in self._types:
|
|
10
|
+
err_cls = type(name, (base,), {"__doc__": doc})
|
|
11
|
+
self._types[name] = err_cls
|
|
12
|
+
return self._types[name]
|
|
13
|
+
|
|
14
|
+
def __getattr__(self, name):
|
|
15
|
+
def raiser(msg, exit=False):
|
|
16
|
+
from .logger import logger
|
|
17
|
+
err_cls = self._types.get(name) or self.register(name)
|
|
18
|
+
exc = err_cls(msg)
|
|
19
|
+
logger.error(f"{name}: {msg} | {err_cls.__doc__}")
|
|
20
|
+
logger.error("".join(traceback.format_stack()))
|
|
21
|
+
if exit:
|
|
22
|
+
raise exc
|
|
23
|
+
return raiser
|
|
24
|
+
|
|
25
|
+
def info(self, name: str = None):
|
|
26
|
+
result = {}
|
|
27
|
+
for err_name, err_cls in self._types.items():
|
|
28
|
+
result[err_name] = {
|
|
29
|
+
"type": err_name,
|
|
30
|
+
"doc": getattr(err_cls, "__doc__", ""),
|
|
31
|
+
"class": err_cls,
|
|
32
|
+
}
|
|
33
|
+
if name is None:
|
|
34
|
+
return result
|
|
35
|
+
err_cls = self._types.get(name)
|
|
36
|
+
if not err_cls:
|
|
37
|
+
return None
|
|
38
|
+
return {
|
|
39
|
+
"type": name,
|
|
40
|
+
"doc": getattr(err_cls, "__doc__", ""),
|
|
41
|
+
"class": err_cls,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
raiserr = Error()
|
ErisPulse/util.py
CHANGED
|
@@ -1,96 +1,73 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: ErisPulse
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary: ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Classifier:
|
|
12
|
-
Classifier:
|
|
13
|
-
Classifier:
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier:
|
|
18
|
-
Classifier:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if __name__ == "__main__":
|
|
75
|
-
asyncio.run(main())
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## 🛠️ 常用命令
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
epsdk update # 更新模块源
|
|
82
|
-
epsdk install AIChat # 安装模块
|
|
83
|
-
epsdk enable AIChat # 启用模块
|
|
84
|
-
epsdk list # 查看所有模块
|
|
85
|
-
```
|
|
86
|
-
更多命令详见 [命令行工具文档](docs/CLI.md)。
|
|
87
|
-
|
|
88
|
-
## 🧩 模块开发
|
|
89
|
-
|
|
90
|
-
你可以通过实现自定义模块扩展 ErisPulse 功能。详见 [开发指南](docs/DEVELOPMENT.md)。
|
|
91
|
-
|
|
92
|
-
## 📖 文档导航
|
|
93
|
-
- [开发指南](docs/DEVELOPMENT.md) - 完整的开发文档
|
|
94
|
-
- [命令行工具](docs/CLI.md) - CLI 使用手册
|
|
95
|
-
- [源配置指南](docs/ORIGIN.md) - 模块源配置说明
|
|
96
|
-
- [更新日志](docs/CHANGELOG.md) - 版本更新历史
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ErisPulse
|
|
3
|
+
Version: 1.0.14.dev1
|
|
4
|
+
Summary: ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
5
|
+
Author-email: "艾莉丝·格雷拉特(WSu2059)" <wsu2059@qq.com>, runoneall <runoobsteve@gmail.com>
|
|
6
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
7
|
+
Classifier: Intended Audience :: Developers
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Requires-Python: >=3.7
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: aiohttp
|
|
22
|
+
|
|
23
|
+
⚠ 当前版本处于开发中,请谨慎使用。
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
基于 [RyhBotPythonSDK V2](https://github.com/runoneall/RyhBotPythonSDK2) 构建,由 [sdkFrame](https://github.com/runoneall/sdkFrame) 提供支持的异步机器人开发框架。
|
|
28
|
+
|
|
29
|
+
## ✨ 核心特性
|
|
30
|
+
- ⚡ 完全异步架构设计(async/await)
|
|
31
|
+
- 🧩 模块化插件系统
|
|
32
|
+
- 📜 内置日志系统
|
|
33
|
+
- 🛑 统一的错误管理
|
|
34
|
+
- 🛠️ 灵活的配置管理
|
|
35
|
+
|
|
36
|
+
## 📦 安装
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install ErisPulse --upgrade
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**要求**:Python ≥ 3.7,pip ≥ 20.0
|
|
43
|
+
|
|
44
|
+
## 🚀 快速开始
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
import asyncio
|
|
48
|
+
from ErisPulse import sdk, logger
|
|
49
|
+
|
|
50
|
+
async def main():
|
|
51
|
+
sdk.init()
|
|
52
|
+
logger.info("ErisPulse 已启动")
|
|
53
|
+
# 这里可以添加自定义逻辑 | 如模块的 AddHandle,AddTrigger 等
|
|
54
|
+
|
|
55
|
+
if __name__ == "__main__":
|
|
56
|
+
asyncio.run(main())
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 导航
|
|
60
|
+
- [开发指南](docs/DEVELOPMENT.md) - 完整的开发文档
|
|
61
|
+
- [命令行工具](docs/CLI.md) - CLI 使用手册
|
|
62
|
+
- [源配置指南](docs/ORIGIN.md) - 模块源配置说明
|
|
63
|
+
- [更新日志](docs/CHANGELOG.md) - 版本更新历史
|
|
64
|
+
- [底层API](docs/REFERENCE.md) - 方法与接口
|
|
65
|
+
- [GitHub Discussions](https://github.com/ErisPulse/ErisPulse/discussions)
|
|
66
|
+
|
|
67
|
+
## 🤝 贡献
|
|
68
|
+
|
|
69
|
+
欢迎任何形式的贡献!无论是报告 bug、提出新功能请求,还是直接提交代码,都非常感谢。
|
|
70
|
+
|
|
71
|
+
## 📄 许可证
|
|
72
|
+
|
|
73
|
+
本项目采用 [MIT 许可证](LICENSE)。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
ErisPulse/__init__.py,sha256=75SfkJEYHy73K3UGaEuMYlHtJadjpoNWd1yF-f5-aGc,6662
|
|
2
|
+
ErisPulse/__main__.py,sha256=1-mWPmZArG-o_eYxZiabmMs4MokQn_-TBa43R4_WYlc,32141
|
|
3
|
+
ErisPulse/db.py,sha256=2vBVFFEU-AcR-GkzWTqpn8fFV9EvuQee2mi1XzfDXVI,9077
|
|
4
|
+
ErisPulse/logger.py,sha256=AVjBuoF18Wu6mPMxB90i7Nge0IoMx2xPlTYrQX-UKaU,4973
|
|
5
|
+
ErisPulse/raiserr.py,sha256=WTMQEUbUSx4PS9_l9cEnuNuvm6zulgwQFipqVZZg3zc,1296
|
|
6
|
+
ErisPulse/util.py,sha256=90j71c32yP-s2zy1SM-1FExJRu7pWpkuPVQSXCaVTrg,1087
|
|
7
|
+
erispulse-1.0.14.dev1.dist-info/METADATA,sha256=132PK2kNWhBPBoQdx-9yf6wJV7RNQpksk3EjwMdAjOc,2502
|
|
8
|
+
erispulse-1.0.14.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
+
erispulse-1.0.14.dev1.dist-info/entry_points.txt,sha256=AjKvOdYR7QGXVpEJhjUYUwV2JluE4lm9vNbknC3hjOM,155
|
|
10
|
+
erispulse-1.0.14.dev1.dist-info/top_level.txt,sha256=Lm_qtkVvNJR8_dXh_qEDdl_12cZGpic-i4HUlVVUMZc,10
|
|
11
|
+
erispulse-1.0.14.dev1.dist-info/RECORD,,
|
ErisPulse/errors.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
class CycleDependencyError(Exception):
|
|
2
|
-
def __init__(self, message):
|
|
3
|
-
self.message = message
|
|
4
|
-
super().__init__(self.message)
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class InvalidDependencyError(Exception):
|
|
8
|
-
def __init__(self, message):
|
|
9
|
-
self.message = message
|
|
10
|
-
super().__init__(self.message)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class InvalidModuleError(Exception):
|
|
14
|
-
def __init__(self, message):
|
|
15
|
-
self.message = message
|
|
16
|
-
super().__init__(self.message)
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
ErisPulse/__init__.py,sha256=dh9zmUfcxnMGBWZqrOaQf0cTL5tGur74JEu_X_y-7Ek,6445
|
|
2
|
-
ErisPulse/__main__.py,sha256=o7XC7h4HrsaRXmkOWRohGslqXIQC0GSuYNPHrPjL_mA,40422
|
|
3
|
-
ErisPulse/envManager.py,sha256=xUtzP8CWT0KnyyYE8Fm_5UB2VsMi1ODLHMKUoGCWwO4,9304
|
|
4
|
-
ErisPulse/errors.py,sha256=DwIQ2nx3GyxSY0ogoeezTSP11MwSVFeR1tx7obkP9Rs,430
|
|
5
|
-
ErisPulse/logger.py,sha256=Axlne7pLIsx1baq__37_rn_GGwlz8d6Bet-nuUR0eEc,1419
|
|
6
|
-
ErisPulse/util.py,sha256=6SawalGTS7y_TbTY8W6SMTIRN5Z2TgJoHZwQ8zaE_k0,1111
|
|
7
|
-
erispulse-1.0.12.dist-info/METADATA,sha256=KYLAFdq4pky8eF4sxwY6EfQgas0UUg0BiO70L2kisYk,2989
|
|
8
|
-
erispulse-1.0.12.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
|
9
|
-
erispulse-1.0.12.dist-info/entry_points.txt,sha256=AjKvOdYR7QGXVpEJhjUYUwV2JluE4lm9vNbknC3hjOM,155
|
|
10
|
-
erispulse-1.0.12.dist-info/top_level.txt,sha256=Lm_qtkVvNJR8_dXh_qEDdl_12cZGpic-i4HUlVVUMZc,10
|
|
11
|
-
erispulse-1.0.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|