ErisPulse 1.0.4__zip → 1.0.6__zip
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-1.0.4 → erispulse-1.0.6}/ErisPulse/__main__.py +165 -117
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse/envManager.py +21 -12
- erispulse-1.0.6/ErisPulse.egg-info/PKG-INFO +51 -0
- erispulse-1.0.6/PKG-INFO +51 -0
- erispulse-1.0.6/README.md +15 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/setup.py +1 -1
- erispulse-1.0.4/ErisPulse.egg-info/PKG-INFO +0 -128
- erispulse-1.0.4/PKG-INFO +0 -128
- erispulse-1.0.4/README.md +0 -92
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse/__init__.py +0 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse/errors.py +0 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse/logger.py +0 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse/origin.py +0 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse/sdk.py +0 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse/util.py +0 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse.egg-info/SOURCES.txt +0 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse.egg-info/dependency_links.txt +0 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse.egg-info/requires.txt +0 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/ErisPulse.egg-info/top_level.txt +0 -0
- {erispulse-1.0.4 → erispulse-1.0.6}/setup.cfg +0 -0
|
@@ -5,35 +5,46 @@ import shutil
|
|
|
5
5
|
import aiohttp
|
|
6
6
|
import zipfile
|
|
7
7
|
import asyncio
|
|
8
|
+
import subprocess
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
from rich.table import Table
|
|
11
|
+
from rich.panel import Panel
|
|
12
|
+
from rich.text import Text
|
|
13
|
+
from rich.prompt import Prompt, Confirm
|
|
14
|
+
from rich.progress import track
|
|
8
15
|
from .envManager import env
|
|
9
16
|
from .origin import origin_manager
|
|
10
17
|
|
|
18
|
+
console = Console()
|
|
19
|
+
|
|
11
20
|
def enable_module(module_name):
|
|
12
21
|
module_info = env.get_module(module_name)
|
|
13
22
|
if module_info:
|
|
14
23
|
env.set_module_status(module_name, True)
|
|
15
|
-
print(f"模块 {module_name} 已启用")
|
|
24
|
+
console.print(f"[green]模块 {module_name} 已启用[/green]")
|
|
16
25
|
else:
|
|
17
|
-
print(f"模块 {module_name} 不存在")
|
|
26
|
+
console.print(f"[red]模块 {module_name} 不存在[/red]")
|
|
18
27
|
|
|
19
28
|
def disable_module(module_name):
|
|
20
29
|
module_info = env.get_module(module_name)
|
|
21
30
|
if module_info:
|
|
22
31
|
env.set_module_status(module_name, False)
|
|
23
|
-
print(f"模块 {module_name} 已禁用")
|
|
32
|
+
console.print(f"[yellow]模块 {module_name} 已禁用[/yellow]")
|
|
24
33
|
else:
|
|
25
|
-
print(f"模块 {module_name} 不存在")
|
|
34
|
+
console.print(f"[red]模块 {module_name} 不存在[/red]")
|
|
35
|
+
|
|
26
36
|
async def fetch_url(session, url):
|
|
27
37
|
try:
|
|
28
38
|
async with session.get(url) as response:
|
|
29
39
|
response.raise_for_status()
|
|
30
40
|
return await response.read()
|
|
31
41
|
except Exception as e:
|
|
32
|
-
print(f"请求失败: {e}")
|
|
42
|
+
console.print(f"[red]请求失败: {e}[/red]")
|
|
33
43
|
return None
|
|
44
|
+
|
|
34
45
|
def extract_and_setup_module(module_name, module_url, zip_path, module_dir):
|
|
35
46
|
try:
|
|
36
|
-
print(f"正在从 {module_url} 下载模块...")
|
|
47
|
+
console.print(f"[cyan]正在从 {module_url} 下载模块...[/cyan]")
|
|
37
48
|
|
|
38
49
|
async def download_module():
|
|
39
50
|
async with aiohttp.ClientSession() as session:
|
|
@@ -64,18 +75,18 @@ def extract_and_setup_module(module_name, module_url, zip_path, module_dir):
|
|
|
64
75
|
shutil.move(source_item, module_dir)
|
|
65
76
|
os.rmdir(sub_dir)
|
|
66
77
|
|
|
67
|
-
print(f"模块 {module_name} 文件已成功解压并设置")
|
|
78
|
+
console.print(f"[green]模块 {module_name} 文件已成功解压并设置[/green]")
|
|
68
79
|
return True
|
|
69
80
|
|
|
70
81
|
return asyncio.run(download_module())
|
|
71
82
|
|
|
72
83
|
except Exception as e:
|
|
73
|
-
print(f"处理模块 {module_name} 文件失败: {e}")
|
|
84
|
+
console.print(Panel(f"[red]处理模块 {module_name} 文件失败: {e}[/red]", title="错误", border_style="red"))
|
|
74
85
|
if os.path.exists(zip_path):
|
|
75
86
|
try:
|
|
76
87
|
os.remove(zip_path)
|
|
77
88
|
except Exception as cleanup_error:
|
|
78
|
-
print(f"清理失败: {cleanup_error}")
|
|
89
|
+
console.print(f"[red]清理失败: {cleanup_error}[/red]")
|
|
79
90
|
return False
|
|
80
91
|
|
|
81
92
|
finally:
|
|
@@ -83,19 +94,37 @@ def extract_and_setup_module(module_name, module_url, zip_path, module_dir):
|
|
|
83
94
|
try:
|
|
84
95
|
os.remove(zip_path)
|
|
85
96
|
except Exception as cleanup_error:
|
|
86
|
-
print(f"清理失败: {cleanup_error}")
|
|
97
|
+
console.print(f"[red]清理失败: {cleanup_error}[/red]")
|
|
98
|
+
|
|
99
|
+
def install_pip_dependencies(dependencies):
|
|
100
|
+
if not dependencies:
|
|
101
|
+
return True
|
|
102
|
+
|
|
103
|
+
console.print("[cyan]正在安装pip依赖...[/cyan]")
|
|
104
|
+
try:
|
|
105
|
+
result = subprocess.run(
|
|
106
|
+
[sys.executable, "-m", "pip", "install"] + dependencies,
|
|
107
|
+
check=True,
|
|
108
|
+
stdout=subprocess.PIPE,
|
|
109
|
+
stderr=subprocess.PIPE
|
|
110
|
+
)
|
|
111
|
+
console.print(result.stdout.decode())
|
|
112
|
+
return True
|
|
113
|
+
except subprocess.CalledProcessError as e:
|
|
114
|
+
console.print(Panel(f"[red]安装pip依赖失败: {e.stderr.decode()}[/red]", title="错误", border_style="red"))
|
|
115
|
+
return False
|
|
87
116
|
|
|
88
117
|
def install_module(module_name, force=False):
|
|
89
118
|
module_info = env.get_module(module_name)
|
|
90
119
|
if module_info and not force:
|
|
91
|
-
print(f"模块 {module_name} 已存在,使用 --force 参数强制重装")
|
|
120
|
+
console.print(f"[yellow]模块 {module_name} 已存在,使用 --force 参数强制重装[/yellow]")
|
|
92
121
|
return
|
|
93
122
|
|
|
94
123
|
providers = env.get('providers', {})
|
|
95
124
|
if isinstance(providers, str):
|
|
96
125
|
providers = json.loads(providers)
|
|
97
|
-
module_info = []
|
|
98
126
|
|
|
127
|
+
module_info = []
|
|
99
128
|
for provider, url in providers.items():
|
|
100
129
|
module_key = f"{module_name}@{provider}"
|
|
101
130
|
modules_data = env.get('modules', {})
|
|
@@ -112,48 +141,47 @@ def install_module(module_name, force=False):
|
|
|
112
141
|
'description': module_data.get('description', '无描述'),
|
|
113
142
|
'author': module_data.get('author', '未知'),
|
|
114
143
|
'dependencies': module_data.get('dependencies', []),
|
|
115
|
-
'optional_dependencies': module_data.get('optional_dependencies', [])
|
|
144
|
+
'optional_dependencies': module_data.get('optional_dependencies', []),
|
|
145
|
+
'pip_dependencies': module_data.get('pip_dependencies', [])
|
|
116
146
|
})
|
|
117
147
|
|
|
118
148
|
if not module_info:
|
|
119
|
-
print(f"未找到模块 {module_name}")
|
|
149
|
+
console.print(f"[red]未找到模块 {module_name}[/red]")
|
|
120
150
|
return
|
|
121
151
|
|
|
122
152
|
if len(module_info) > 1:
|
|
123
|
-
print(f"找到 {len(module_info)} 个源的 {module_name} 模块:")
|
|
153
|
+
console.print(f"[cyan]找到 {len(module_info)} 个源的 {module_name} 模块:[/cyan]")
|
|
154
|
+
table = Table(title="可选模块源", show_header=True, header_style="bold magenta")
|
|
155
|
+
table.add_column("编号", style="cyan")
|
|
156
|
+
table.add_column("源", style="green")
|
|
157
|
+
table.add_column("版本", style="blue")
|
|
158
|
+
table.add_column("描述", style="white")
|
|
159
|
+
table.add_column("作者", style="yellow")
|
|
124
160
|
for i, info in enumerate(module_info):
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
print(f" 描述: {info['description']}")
|
|
128
|
-
print(f" 作者: {info['author']}")
|
|
129
|
-
print(f" 依赖: {', '.join(info['dependencies']) if info['dependencies'] else '无'}")
|
|
130
|
-
print()
|
|
161
|
+
table.add_row(str(i+1), info['provider'], info['version'], info['description'], info['author'])
|
|
162
|
+
console.print(table)
|
|
131
163
|
|
|
132
164
|
while True:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
print("输入无效,请重新选择")
|
|
140
|
-
except ValueError:
|
|
141
|
-
print("请输入有效的数字")
|
|
165
|
+
choice = Prompt.ask("请选择要安装的源 (输入编号)", default="1")
|
|
166
|
+
if choice.isdigit() and 1 <= int(choice) <= len(module_info):
|
|
167
|
+
selected_module = module_info[int(choice)-1]
|
|
168
|
+
break
|
|
169
|
+
else:
|
|
170
|
+
console.print("[red]输入无效,请重新选择[/red]")
|
|
142
171
|
else:
|
|
143
172
|
selected_module = module_info[0]
|
|
144
173
|
|
|
145
174
|
for dep in selected_module['dependencies']:
|
|
146
|
-
print(f"正在安装依赖模块 {dep}...")
|
|
175
|
+
console.print(f"[cyan]正在安装依赖模块 {dep}...[/cyan]")
|
|
147
176
|
install_module(dep)
|
|
148
177
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
print("\033[93m\033[1m" + f"模块 {module_name} 有可选依赖:{', '.join(optional_deps_message)},请稍后手动选择安装!" + "\033[0m")
|
|
178
|
+
third_party_deps = selected_module.get('pip_dependencies', [])
|
|
179
|
+
if third_party_deps:
|
|
180
|
+
console.print(f"[cyan]模块 {module_name} 需要以下pip依赖: {', '.join(third_party_deps)}[/cyan]")
|
|
181
|
+
if not install_pip_dependencies(third_party_deps):
|
|
182
|
+
console.print(f"[red]无法安装模块 {module_name} 的pip依赖,安装终止[/red]")
|
|
183
|
+
return
|
|
184
|
+
|
|
157
185
|
module_url = selected_module['url'] + selected_module['path']
|
|
158
186
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
159
187
|
module_dir = os.path.join(script_dir, 'modules', module_name)
|
|
@@ -166,6 +194,7 @@ def install_module(module_name, force=False):
|
|
|
166
194
|
module_dir=module_dir
|
|
167
195
|
):
|
|
168
196
|
return
|
|
197
|
+
|
|
169
198
|
env.set_module(module_name, {
|
|
170
199
|
'status': True,
|
|
171
200
|
'info': {
|
|
@@ -173,10 +202,11 @@ def install_module(module_name, force=False):
|
|
|
173
202
|
'description': selected_module['description'],
|
|
174
203
|
'author': selected_module['author'],
|
|
175
204
|
'dependencies': selected_module['dependencies'],
|
|
176
|
-
'optional_dependencies': selected_module['optional_dependencies']
|
|
205
|
+
'optional_dependencies': selected_module['optional_dependencies'],
|
|
206
|
+
'pip_dependencies': selected_module['pip_dependencies']
|
|
177
207
|
}
|
|
178
208
|
})
|
|
179
|
-
print(f"模块 {module_name} 安装成功")
|
|
209
|
+
console.print(f"[green]模块 {module_name} 安装成功[/green]")
|
|
180
210
|
|
|
181
211
|
def uninstall_module(module_name):
|
|
182
212
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
@@ -187,25 +217,65 @@ def uninstall_module(module_name):
|
|
|
187
217
|
try:
|
|
188
218
|
os.remove(module_file_path)
|
|
189
219
|
except Exception as e:
|
|
190
|
-
print(f"删除模块文件 {module_name} 时出错: {e}")
|
|
220
|
+
console.print(f"[red]删除模块文件 {module_name} 时出错: {e}[/red]")
|
|
191
221
|
elif os.path.exists(module_path) and os.path.isdir(module_path):
|
|
192
222
|
try:
|
|
193
223
|
shutil.rmtree(module_path)
|
|
194
224
|
except Exception as e:
|
|
195
|
-
print(f"删除模块目录 {module_name} 时出错: {e}")
|
|
225
|
+
console.print(f"[red]删除模块目录 {module_name} 时出错: {e}[/red]")
|
|
196
226
|
else:
|
|
197
|
-
print(f"模块 {module_name} 不存在")
|
|
227
|
+
console.print(f"[red]模块 {module_name} 不存在[/red]")
|
|
228
|
+
return
|
|
229
|
+
|
|
230
|
+
module_info = env.get_module(module_name)
|
|
231
|
+
if not module_info:
|
|
232
|
+
console.print(f"[red]模块 {module_name} 不存在[/red]")
|
|
198
233
|
return
|
|
234
|
+
|
|
235
|
+
pip_dependencies = module_info.get('info', {}).get('pip_dependencies', [])
|
|
236
|
+
if pip_dependencies:
|
|
237
|
+
all_modules = env.get_all_modules()
|
|
238
|
+
unused_pip_dependencies = []
|
|
239
|
+
|
|
240
|
+
essential_packages = {'aiohttp', 'rich'}
|
|
199
241
|
|
|
242
|
+
for dep in pip_dependencies:
|
|
243
|
+
if dep in essential_packages:
|
|
244
|
+
console.print(f"[yellow]跳过必要模块 {dep} 的卸载[/yellow]")
|
|
245
|
+
continue
|
|
246
|
+
|
|
247
|
+
is_dependency_used = False
|
|
248
|
+
for name, info in all_modules.items():
|
|
249
|
+
if name != module_name and dep in info.get('info', {}).get('pip_dependencies', []):
|
|
250
|
+
is_dependency_used = True
|
|
251
|
+
break
|
|
252
|
+
if not is_dependency_used:
|
|
253
|
+
unused_pip_dependencies.append(dep)
|
|
254
|
+
|
|
255
|
+
if unused_pip_dependencies:
|
|
256
|
+
console.print(f"[cyan]以下 pip 依赖不再被其他模块使用: {', '.join(unused_pip_dependencies)}[/cyan]")
|
|
257
|
+
confirm = Confirm.ask("[yellow]是否卸载这些 pip 依赖?[/yellow]", default=False)
|
|
258
|
+
if confirm:
|
|
259
|
+
console.print(f"[cyan]正在卸载 pip 依赖: {', '.join(unused_pip_dependencies)}[/cyan]")
|
|
260
|
+
try:
|
|
261
|
+
subprocess.run(
|
|
262
|
+
[sys.executable, "-m", "pip", "uninstall", "-y"] + unused_pip_dependencies,
|
|
263
|
+
check=True,
|
|
264
|
+
stdout=subprocess.PIPE,
|
|
265
|
+
stderr=subprocess.PIPE
|
|
266
|
+
)
|
|
267
|
+
console.print(f"[green]成功卸载 pip 依赖: {', '.join(unused_pip_dependencies)}[/green]")
|
|
268
|
+
except subprocess.CalledProcessError as e:
|
|
269
|
+
console.print(Panel(f"[red]卸载 pip 依赖失败: {e.stderr.decode()}[/red]", title="错误", border_style="red"))
|
|
270
|
+
|
|
200
271
|
if env.remove_module(module_name):
|
|
201
|
-
print(f"模块 {module_name} 已删除")
|
|
272
|
+
console.print(f"[green]模块 {module_name} 已删除[/green]")
|
|
202
273
|
else:
|
|
203
|
-
print(f"模块 {module_name} 不存在")
|
|
204
|
-
|
|
274
|
+
console.print(f"[red]模块 {module_name} 不存在[/red]")
|
|
205
275
|
def upgrade_all_modules(force=False):
|
|
206
276
|
all_modules = env.get_all_modules()
|
|
207
277
|
if not all_modules:
|
|
208
|
-
print("未找到任何模块,无法更新")
|
|
278
|
+
console.print("[yellow]未找到任何模块,无法更新[/yellow]")
|
|
209
279
|
return
|
|
210
280
|
|
|
211
281
|
providers = env.get('providers', {})
|
|
@@ -235,26 +305,27 @@ def upgrade_all_modules(force=False):
|
|
|
235
305
|
})
|
|
236
306
|
|
|
237
307
|
if not updates_available:
|
|
238
|
-
print("所有模块已是最新版本,无需更新")
|
|
308
|
+
console.print("[green]所有模块已是最新版本,无需更新[/green]")
|
|
239
309
|
return
|
|
240
310
|
|
|
241
|
-
print("\n以下模块有可用更新:")
|
|
311
|
+
console.print("\n[cyan]以下模块有可用更新:[/cyan]")
|
|
312
|
+
table = Table(title="可用更新", show_header=True, header_style="bold magenta")
|
|
313
|
+
table.add_column("模块", style="cyan")
|
|
314
|
+
table.add_column("当前版本", style="yellow")
|
|
315
|
+
table.add_column("最新版本", style="green")
|
|
316
|
+
table.add_column("源", style="blue")
|
|
242
317
|
for update in updates_available:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
print(f"最新版本: {update['remote_version']}")
|
|
246
|
-
print(f"源: {update['provider']}")
|
|
247
|
-
print()
|
|
318
|
+
table.add_row(update['name'], update['local_version'], update['remote_version'], update['provider'])
|
|
319
|
+
console.print(table)
|
|
248
320
|
|
|
249
321
|
if not force:
|
|
250
|
-
confirm =
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
print("更新已取消")
|
|
322
|
+
confirm = Confirm.ask("[yellow]警告:更新模块可能会导致兼容性问题,请在更新前查看插件作者的相关声明。\n是否继续?[/yellow]", default=False)
|
|
323
|
+
if not confirm:
|
|
324
|
+
console.print("[yellow]更新已取消[/yellow]")
|
|
254
325
|
return
|
|
255
326
|
|
|
256
327
|
for update in updates_available:
|
|
257
|
-
print(f"正在更新模块 {update['name']}...")
|
|
328
|
+
console.print(f"[cyan]正在更新模块 {update['name']}...[/cyan]")
|
|
258
329
|
module_url = update['url'] + update['path']
|
|
259
330
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
260
331
|
module_dir = os.path.join(script_dir, 'modules', update['name'])
|
|
@@ -270,68 +341,46 @@ def upgrade_all_modules(force=False):
|
|
|
270
341
|
|
|
271
342
|
all_modules[update['name']]['info']['version'] = update['remote_version']
|
|
272
343
|
env.set_all_modules(all_modules)
|
|
273
|
-
print(f"模块 {update['name']} 已更新至版本 {update['remote_version']}")
|
|
344
|
+
console.print(f"[green]模块 {update['name']} 已更新至版本 {update['remote_version']}[/green]")
|
|
274
345
|
|
|
275
|
-
def list_modules(module_name=None
|
|
346
|
+
def list_modules(module_name=None):
|
|
276
347
|
all_modules = env.get_all_modules()
|
|
277
348
|
if not all_modules:
|
|
278
|
-
print("
|
|
349
|
+
console.print("[yellow]未在数据库中发现注册模块,正在初始化模块列表...[/yellow]")
|
|
279
350
|
from . import init as init_module
|
|
280
351
|
init_module()
|
|
281
352
|
all_modules = env.get_all_modules()
|
|
282
|
-
|
|
283
|
-
modules = [{"name": name, **info} for name, info in all_modules.items()]
|
|
284
|
-
|
|
285
|
-
if module_name:
|
|
286
|
-
module = next((m for m in modules if m['name'] == module_name), None)
|
|
287
|
-
if module:
|
|
288
|
-
status = "启用" if module.get("status", True) else "禁用"
|
|
289
|
-
print(f"模块: {module['name']}")
|
|
290
|
-
print(f"状态: {status}")
|
|
291
|
-
print(f"版本: {module['info'].get('version', '未知')}")
|
|
292
|
-
print(f"描述: {module['info'].get('description', '无描述')}")
|
|
293
|
-
print(f"作者: {module['info'].get('author', '未知')}")
|
|
294
|
-
print(f"依赖: {', '.join(module['info'].get('dependencies', [])) if module['info'].get('dependencies') else '无'}")
|
|
295
|
-
else:
|
|
296
|
-
print(f"模块 {module_name} 不存在")
|
|
297
|
-
else:
|
|
298
|
-
total_modules = len(modules)
|
|
299
|
-
total_pages = (total_modules + page_size - 1) // page_size
|
|
300
|
-
current_page = 1
|
|
301
353
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
except KeyboardInterrupt:
|
|
333
|
-
print("\n")
|
|
334
|
-
sys.exit(0)
|
|
354
|
+
if not all_modules:
|
|
355
|
+
console.print("[red]未找到任何模块[/red]")
|
|
356
|
+
return
|
|
357
|
+
|
|
358
|
+
table = Table(title="模块列表", show_header=True, header_style="bold magenta")
|
|
359
|
+
table.add_column("模块名称", style="cyan")
|
|
360
|
+
table.add_column("状态", style="green")
|
|
361
|
+
table.add_column("版本", style="blue")
|
|
362
|
+
table.add_column("描述", style="white")
|
|
363
|
+
table.add_column("依赖", style="yellow")
|
|
364
|
+
table.add_column("可选依赖", style="magenta")
|
|
365
|
+
table.add_column("pip依赖", style="cyan")
|
|
366
|
+
|
|
367
|
+
for name, info in all_modules.items():
|
|
368
|
+
status = "启用" if info.get("status", True) else "禁用"
|
|
369
|
+
dependencies = ', '.join(info['info'].get('dependencies', [])) if info['info'].get('dependencies') else '无'
|
|
370
|
+
optional_dependencies = ', '.join(info['info'].get('optional_dependencies', [])) if info['info'].get('optional_dependencies') else '无'
|
|
371
|
+
pip_dependencies = ', '.join(info['info'].get('pip_dependencies', [])) if info['info'].get('pip_dependencies') else '无'
|
|
372
|
+
table.add_row(
|
|
373
|
+
name,
|
|
374
|
+
status,
|
|
375
|
+
info['info'].get('version', '未知'),
|
|
376
|
+
info['info'].get('description', '无描述'),
|
|
377
|
+
dependencies,
|
|
378
|
+
optional_dependencies,
|
|
379
|
+
pip_dependencies
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
console.print(table)
|
|
383
|
+
|
|
335
384
|
def main():
|
|
336
385
|
parser = argparse.ArgumentParser(
|
|
337
386
|
description="ErisPulse 命令行工具",
|
|
@@ -348,7 +397,6 @@ def main():
|
|
|
348
397
|
disable_parser.add_argument('--init', action='store_true', help='在禁用模块前初始化模块数据库')
|
|
349
398
|
|
|
350
399
|
list_parser = subparsers.add_parser('list', help='列出所有模块信息')
|
|
351
|
-
list_parser.add_argument('--init', action='store_true', help='在列出模块前初始化模块数据库')
|
|
352
400
|
list_parser.add_argument('--module', '-m', type=str, help='指定要展示的模块名称')
|
|
353
401
|
|
|
354
402
|
update_parser = subparsers.add_parser('update', help='更新模块列表')
|
|
@@ -378,7 +426,7 @@ def main():
|
|
|
378
426
|
args = parser.parse_args()
|
|
379
427
|
|
|
380
428
|
if hasattr(args, 'init') and args.init:
|
|
381
|
-
print("正在初始化模块列表...")
|
|
429
|
+
console.print("[yellow]正在初始化模块列表...[/yellow]")
|
|
382
430
|
from . import init as init_module
|
|
383
431
|
init_module()
|
|
384
432
|
|
|
@@ -6,7 +6,7 @@ from pathlib import Path
|
|
|
6
6
|
|
|
7
7
|
class EnvManager:
|
|
8
8
|
_instance = None
|
|
9
|
-
db_path = "
|
|
9
|
+
db_path = os.path.join(os.path.dirname(__file__), "config.db")
|
|
10
10
|
|
|
11
11
|
def __new__(cls, *args, **kwargs):
|
|
12
12
|
if not cls._instance:
|
|
@@ -18,6 +18,8 @@ class EnvManager:
|
|
|
18
18
|
self._init_db()
|
|
19
19
|
|
|
20
20
|
def _init_db(self):
|
|
21
|
+
os.makedirs(os.path.dirname(self.db_path), exist_ok=True)
|
|
22
|
+
|
|
21
23
|
conn = sqlite3.connect(self.db_path)
|
|
22
24
|
cursor = conn.cursor()
|
|
23
25
|
cursor.execute("""
|
|
@@ -34,7 +36,8 @@ class EnvManager:
|
|
|
34
36
|
description TEXT,
|
|
35
37
|
author TEXT,
|
|
36
38
|
dependencies TEXT,
|
|
37
|
-
optional_dependencies TEXT
|
|
39
|
+
optional_dependencies TEXT,
|
|
40
|
+
pip_dependencies TEXT
|
|
38
41
|
)
|
|
39
42
|
""")
|
|
40
43
|
conn.commit()
|
|
@@ -113,8 +116,9 @@ class EnvManager:
|
|
|
113
116
|
for module_name, module_info in modules_info.items():
|
|
114
117
|
cursor.execute("""
|
|
115
118
|
INSERT OR REPLACE INTO modules (
|
|
116
|
-
module_name, status, version, description, author,
|
|
117
|
-
|
|
119
|
+
module_name, status, version, description, author,
|
|
120
|
+
dependencies, optional_dependencies, pip_dependencies
|
|
121
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
118
122
|
""", (
|
|
119
123
|
module_name,
|
|
120
124
|
int(module_info.get('status', True)),
|
|
@@ -122,7 +126,8 @@ class EnvManager:
|
|
|
122
126
|
module_info.get('info', {}).get('description', ''),
|
|
123
127
|
module_info.get('info', {}).get('author', ''),
|
|
124
128
|
json.dumps(module_info.get('info', {}).get('dependencies', [])),
|
|
125
|
-
json.dumps(module_info.get('info', {}).get('optional_dependencies', []))
|
|
129
|
+
json.dumps(module_info.get('info', {}).get('optional_dependencies', [])),
|
|
130
|
+
json.dumps(module_info.get('info', {}).get('pip_dependencies', [])) # 新增
|
|
126
131
|
))
|
|
127
132
|
conn.commit()
|
|
128
133
|
|
|
@@ -133,7 +138,7 @@ class EnvManager:
|
|
|
133
138
|
rows = cursor.fetchall()
|
|
134
139
|
modules_info = {}
|
|
135
140
|
for row in rows:
|
|
136
|
-
module_name, status, version, description, author, dependencies, optional_dependencies = row
|
|
141
|
+
module_name, status, version, description, author, dependencies, optional_dependencies, pip_dependencies = row
|
|
137
142
|
modules_info[module_name] = {
|
|
138
143
|
'status': bool(status),
|
|
139
144
|
'info': {
|
|
@@ -141,7 +146,8 @@ class EnvManager:
|
|
|
141
146
|
'description': description,
|
|
142
147
|
'author': author,
|
|
143
148
|
'dependencies': json.loads(dependencies) if dependencies else [],
|
|
144
|
-
'optional_dependencies': json.loads(optional_dependencies) if optional_dependencies else []
|
|
149
|
+
'optional_dependencies': json.loads(optional_dependencies) if optional_dependencies else [],
|
|
150
|
+
'pip_dependencies': json.loads(pip_dependencies) if pip_dependencies else [] # 新增
|
|
145
151
|
}
|
|
146
152
|
}
|
|
147
153
|
return modules_info
|
|
@@ -152,7 +158,7 @@ class EnvManager:
|
|
|
152
158
|
cursor.execute("SELECT * FROM modules WHERE module_name = ?", (module_name,))
|
|
153
159
|
row = cursor.fetchone()
|
|
154
160
|
if row:
|
|
155
|
-
module_name, status, version, description, author, dependencies, optional_dependencies = row
|
|
161
|
+
module_name, status, version, description, author, dependencies, optional_dependencies, pip_dependencies = row
|
|
156
162
|
return {
|
|
157
163
|
'status': bool(status),
|
|
158
164
|
'info': {
|
|
@@ -160,7 +166,8 @@ class EnvManager:
|
|
|
160
166
|
'description': description,
|
|
161
167
|
'author': author,
|
|
162
168
|
'dependencies': json.loads(dependencies) if dependencies else [],
|
|
163
|
-
'optional_dependencies': json.loads(optional_dependencies) if optional_dependencies else []
|
|
169
|
+
'optional_dependencies': json.loads(optional_dependencies) if optional_dependencies else [],
|
|
170
|
+
'pip_dependencies': json.loads(pip_dependencies) if pip_dependencies else [] # 新增
|
|
164
171
|
}
|
|
165
172
|
}
|
|
166
173
|
return None
|
|
@@ -170,8 +177,9 @@ class EnvManager:
|
|
|
170
177
|
cursor = conn.cursor()
|
|
171
178
|
cursor.execute("""
|
|
172
179
|
INSERT OR REPLACE INTO modules (
|
|
173
|
-
module_name, status, version, description, author,
|
|
174
|
-
|
|
180
|
+
module_name, status, version, description, author,
|
|
181
|
+
dependencies, optional_dependencies, pip_dependencies
|
|
182
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
175
183
|
""", (
|
|
176
184
|
module_name,
|
|
177
185
|
int(module_info.get('status', True)),
|
|
@@ -179,7 +187,8 @@ class EnvManager:
|
|
|
179
187
|
module_info.get('info', {}).get('description', ''),
|
|
180
188
|
module_info.get('info', {}).get('author', ''),
|
|
181
189
|
json.dumps(module_info.get('info', {}).get('dependencies', [])),
|
|
182
|
-
json.dumps(module_info.get('info', {}).get('optional_dependencies', []))
|
|
190
|
+
json.dumps(module_info.get('info', {}).get('optional_dependencies', [])),
|
|
191
|
+
json.dumps(module_info.get('info', {}).get('pip_dependencies', [])) # 新增
|
|
183
192
|
))
|
|
184
193
|
conn.commit()
|
|
185
194
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: ErisPulse
|
|
3
|
+
Version: 1.0.6
|
|
4
|
+
Summary: ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
5
|
+
Home-page: https://github.com/wsu2059q/ErisPulse
|
|
6
|
+
Author: 艾莉丝·格雷拉特(WSu2059)
|
|
7
|
+
Author-email: wsu2059@qq.com
|
|
8
|
+
Maintainer: runoneall
|
|
9
|
+
Maintainer-email: runoobsteve@gmail.com
|
|
10
|
+
License: MIT
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.7
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Requires-Dist: aiohttp
|
|
23
|
+
Requires-Dist: rich
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: author-email
|
|
26
|
+
Dynamic: classifier
|
|
27
|
+
Dynamic: description
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: license
|
|
31
|
+
Dynamic: maintainer
|
|
32
|
+
Dynamic: maintainer-email
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
36
|
+
|
|
37
|
+
# ErisPulse
|
|
38
|
+
|
|
39
|
+
本项目基于 [RyhBotPythonSDK V2](https://github.com/runoneall/RyhBotPythonSDK2) 构建,并由 [sdkFrame](https://github.com/runoneall/sdkFrame) 提供支持。这是一个异步版本的 SDK,可能在功能和特性上与原库存在一定差异。
|
|
40
|
+
|
|
41
|
+
ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
42
|
+
|
|
43
|
+
# 更新日志
|
|
44
|
+
## 1.0.4
|
|
45
|
+
修复了部分命令行不支持logger颜色代码的问题 | 替换为rich
|
|
46
|
+
|
|
47
|
+
## 1.0.5
|
|
48
|
+
更新了SDK 模块对于pip依赖安装的支持
|
|
49
|
+
|
|
50
|
+
## 1.0.6
|
|
51
|
+
修复了SDK-CLI中的颜色乱码问题,并将db调整为包内存储,以解决多进程问题
|
erispulse-1.0.6/PKG-INFO
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: ErisPulse
|
|
3
|
+
Version: 1.0.6
|
|
4
|
+
Summary: ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
5
|
+
Home-page: https://github.com/wsu2059q/ErisPulse
|
|
6
|
+
Author: 艾莉丝·格雷拉特(WSu2059)
|
|
7
|
+
Author-email: wsu2059@qq.com
|
|
8
|
+
Maintainer: runoneall
|
|
9
|
+
Maintainer-email: runoobsteve@gmail.com
|
|
10
|
+
License: MIT
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.7
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Requires-Dist: aiohttp
|
|
23
|
+
Requires-Dist: rich
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: author-email
|
|
26
|
+
Dynamic: classifier
|
|
27
|
+
Dynamic: description
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: license
|
|
31
|
+
Dynamic: maintainer
|
|
32
|
+
Dynamic: maintainer-email
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
36
|
+
|
|
37
|
+
# ErisPulse
|
|
38
|
+
|
|
39
|
+
本项目基于 [RyhBotPythonSDK V2](https://github.com/runoneall/RyhBotPythonSDK2) 构建,并由 [sdkFrame](https://github.com/runoneall/sdkFrame) 提供支持。这是一个异步版本的 SDK,可能在功能和特性上与原库存在一定差异。
|
|
40
|
+
|
|
41
|
+
ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
42
|
+
|
|
43
|
+
# 更新日志
|
|
44
|
+
## 1.0.4
|
|
45
|
+
修复了部分命令行不支持logger颜色代码的问题 | 替换为rich
|
|
46
|
+
|
|
47
|
+
## 1.0.5
|
|
48
|
+
更新了SDK 模块对于pip依赖安装的支持
|
|
49
|
+
|
|
50
|
+
## 1.0.6
|
|
51
|
+
修复了SDK-CLI中的颜色乱码问题,并将db调整为包内存储,以解决多进程问题
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# ErisPulse
|
|
2
|
+
|
|
3
|
+
本项目基于 [RyhBotPythonSDK V2](https://github.com/runoneall/RyhBotPythonSDK2) 构建,并由 [sdkFrame](https://github.com/runoneall/sdkFrame) 提供支持。这是一个异步版本的 SDK,可能在功能和特性上与原库存在一定差异。
|
|
4
|
+
|
|
5
|
+
ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
6
|
+
|
|
7
|
+
# 更新日志
|
|
8
|
+
## 1.0.4
|
|
9
|
+
修复了部分命令行不支持logger颜色代码的问题 | 替换为rich
|
|
10
|
+
|
|
11
|
+
## 1.0.5
|
|
12
|
+
更新了SDK 模块对于pip依赖安装的支持
|
|
13
|
+
|
|
14
|
+
## 1.0.6
|
|
15
|
+
修复了SDK-CLI中的颜色乱码问题,并将db调整为包内存储,以解决多进程问题
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: ErisPulse
|
|
3
|
-
Version: 1.0.4
|
|
4
|
-
Summary: ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
5
|
-
Home-page: https://github.com/wsu2059q/ErisPulse
|
|
6
|
-
Author: 艾莉丝·格雷拉特(WSu2059)
|
|
7
|
-
Author-email: wsu2059@qq.com
|
|
8
|
-
Maintainer: runoneall
|
|
9
|
-
Maintainer-email: runoobsteve@gmail.com
|
|
10
|
-
License: MIT
|
|
11
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Operating System :: OS Independent
|
|
19
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
-
Requires-Python: >=3.7
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
Requires-Dist: aiohttp
|
|
23
|
-
Requires-Dist: rich
|
|
24
|
-
Dynamic: author
|
|
25
|
-
Dynamic: author-email
|
|
26
|
-
Dynamic: classifier
|
|
27
|
-
Dynamic: description
|
|
28
|
-
Dynamic: description-content-type
|
|
29
|
-
Dynamic: home-page
|
|
30
|
-
Dynamic: license
|
|
31
|
-
Dynamic: maintainer
|
|
32
|
-
Dynamic: maintainer-email
|
|
33
|
-
Dynamic: requires-dist
|
|
34
|
-
Dynamic: requires-python
|
|
35
|
-
Dynamic: summary
|
|
36
|
-
|
|
37
|
-
### 版本更新小通知~
|
|
38
|
-
- 此版本(1.0.4)修复了部分命令行不支持logger颜色代码的问题 | 替换为rich
|
|
39
|
-
|
|
40
|
-
# ErisPulse
|
|
41
|
-
|
|
42
|
-
本项目基于 [RyhBotPythonSDK V2](https://github.com/runoneall/RyhBotPythonSDK2) 构建,并由 [sdkFrame](https://github.com/runoneall/sdkFrame) 提供支持。这是一个异步版本的 SDK,可能在功能和特性上与原库存在一定差异。
|
|
43
|
-
|
|
44
|
-
ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
45
|
-
|
|
46
|
-
## 开发指南
|
|
47
|
-
|
|
48
|
-
项目的模块化设计允许开发者通过实现符合规范的模块快速扩展功能。模块的结构和接口规范可以参考 [开发指南](https://github.com/wsu2059q/ErisPulse/blob/main/%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97.md)。
|
|
49
|
-
|
|
50
|
-
### CLI命令介绍
|
|
51
|
-
|
|
52
|
-
`ErisPulse` 提供了丰富的 CLI 命令,用于管理模块、源和环境配置。以下是主要命令:
|
|
53
|
-
|
|
54
|
-
| 命令 | 功能描述 |
|
|
55
|
-
|-------------------------------|------------------------------------|
|
|
56
|
-
| `enable <module_name>` | 启用指定模块 |
|
|
57
|
-
| `disable <module_name>` | 禁用指定模块 |
|
|
58
|
-
| `list [--module <module_name>]` | 列出所有模块或指定模块的详细信息 |
|
|
59
|
-
| `update` | 更新模块列表 |
|
|
60
|
-
| `upgrade [--force]` | 升级所有模块到最新版本 |
|
|
61
|
-
| `uninstall <module_name>` | 删除指定模块 |
|
|
62
|
-
| `install <module_name>` | 安装指定模块,支持多个模块 |
|
|
63
|
-
|
|
64
|
-
#### 模块源管理命令
|
|
65
|
-
|
|
66
|
-
| 命令 | 功能描述 |
|
|
67
|
-
|-------------------------------|------------------------------------|
|
|
68
|
-
| `origin add <url>` | 添加新的模块源 |
|
|
69
|
-
| `origin list` | 列出所有已配置的模块源 |
|
|
70
|
-
| `origin del <url>` | 删除指定的模块源 |
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
### 模块源
|
|
76
|
-
|
|
77
|
-
在使用 `ErisPulse` 时,模块源是管理模块的重要组成部分。根据不同的使用场景,模块源分为两种类型:**异步模块源** 和 **同步模块源**。以下是它们的详细说明:
|
|
78
|
-
|
|
79
|
-
#### 异步模块源
|
|
80
|
-
- URL 1: [https://github.com/wsu2059q/AsyncRBPS-Origin/raw/refs/heads/main/map.json](https://github.com/wsu2059q/AsyncRBPS-Origin/raw/refs/heads/main/map.json)
|
|
81
|
-
- URL 2: [https://sdkframe.anran.xyz/map.json](https://sdkframe.anran.xyz/map.json)
|
|
82
|
-
- 特性:
|
|
83
|
-
- 支持异步加载模块。
|
|
84
|
-
- 适用于需要高性能和非阻塞操作的场景。
|
|
85
|
-
- 推荐用于现代异步框架和应用。
|
|
86
|
-
|
|
87
|
-
#### 同步模块源
|
|
88
|
-
- URL: [https://runoneall.serv00.net/ryhsdk2/map.json](https://runoneall.serv00.net/ryhsdk2/map.json)
|
|
89
|
-
- 特性:
|
|
90
|
-
- 传统同步加载模块。
|
|
91
|
-
- 适用于兼容性要求较高的场景。
|
|
92
|
-
- 可能会在某些高并发场景下表现不如异步源。
|
|
93
|
-
|
|
94
|
-
#### 自定义模块源
|
|
95
|
-
用户可以搭建自己的模块源,以下是一个示例格式:
|
|
96
|
-
```json
|
|
97
|
-
{
|
|
98
|
-
"name": "Custom-Origin",
|
|
99
|
-
"base": "https://example.com/modules",
|
|
100
|
-
"modules": {
|
|
101
|
-
"CustomModule": {
|
|
102
|
-
"path": "/CustomModule.zip",
|
|
103
|
-
"version": "1.0.0",
|
|
104
|
-
"description": "自定义模块示例",
|
|
105
|
-
"author": "YourName",
|
|
106
|
-
"dependencies": [],
|
|
107
|
-
"optional_dependencies": []
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
#### 提供以下命令方便您快速添加源
|
|
114
|
-
```bash
|
|
115
|
-
# 添加异步模块源
|
|
116
|
-
python -m ErisPulse origin add https://github.com/wsu2059q/AsyncRBPS-Origin/raw/refs/heads/main/
|
|
117
|
-
# 添加同步模块源
|
|
118
|
-
python -m ErisPulse origin add https://runoneall.serv00.net/ryhsdk2/
|
|
119
|
-
|
|
120
|
-
# 添加自定义模块源
|
|
121
|
-
# python -m ErisPulse origin add https://example.com/modules/map.json - (map.json可省略,会自动搜索该文件)
|
|
122
|
-
|
|
123
|
-
# 查看当前配置的模块源
|
|
124
|
-
python -m ErisPulse origin list
|
|
125
|
-
|
|
126
|
-
# 更新模块列表
|
|
127
|
-
python -m ErisPulse update
|
|
128
|
-
```
|
erispulse-1.0.4/PKG-INFO
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: ErisPulse
|
|
3
|
-
Version: 1.0.4
|
|
4
|
-
Summary: ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
5
|
-
Home-page: https://github.com/wsu2059q/ErisPulse
|
|
6
|
-
Author: 艾莉丝·格雷拉特(WSu2059)
|
|
7
|
-
Author-email: wsu2059@qq.com
|
|
8
|
-
Maintainer: runoneall
|
|
9
|
-
Maintainer-email: runoobsteve@gmail.com
|
|
10
|
-
License: MIT
|
|
11
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Operating System :: OS Independent
|
|
19
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
-
Requires-Python: >=3.7
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
Requires-Dist: aiohttp
|
|
23
|
-
Requires-Dist: rich
|
|
24
|
-
Dynamic: author
|
|
25
|
-
Dynamic: author-email
|
|
26
|
-
Dynamic: classifier
|
|
27
|
-
Dynamic: description
|
|
28
|
-
Dynamic: description-content-type
|
|
29
|
-
Dynamic: home-page
|
|
30
|
-
Dynamic: license
|
|
31
|
-
Dynamic: maintainer
|
|
32
|
-
Dynamic: maintainer-email
|
|
33
|
-
Dynamic: requires-dist
|
|
34
|
-
Dynamic: requires-python
|
|
35
|
-
Dynamic: summary
|
|
36
|
-
|
|
37
|
-
### 版本更新小通知~
|
|
38
|
-
- 此版本(1.0.4)修复了部分命令行不支持logger颜色代码的问题 | 替换为rich
|
|
39
|
-
|
|
40
|
-
# ErisPulse
|
|
41
|
-
|
|
42
|
-
本项目基于 [RyhBotPythonSDK V2](https://github.com/runoneall/RyhBotPythonSDK2) 构建,并由 [sdkFrame](https://github.com/runoneall/sdkFrame) 提供支持。这是一个异步版本的 SDK,可能在功能和特性上与原库存在一定差异。
|
|
43
|
-
|
|
44
|
-
ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
45
|
-
|
|
46
|
-
## 开发指南
|
|
47
|
-
|
|
48
|
-
项目的模块化设计允许开发者通过实现符合规范的模块快速扩展功能。模块的结构和接口规范可以参考 [开发指南](https://github.com/wsu2059q/ErisPulse/blob/main/%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97.md)。
|
|
49
|
-
|
|
50
|
-
### CLI命令介绍
|
|
51
|
-
|
|
52
|
-
`ErisPulse` 提供了丰富的 CLI 命令,用于管理模块、源和环境配置。以下是主要命令:
|
|
53
|
-
|
|
54
|
-
| 命令 | 功能描述 |
|
|
55
|
-
|-------------------------------|------------------------------------|
|
|
56
|
-
| `enable <module_name>` | 启用指定模块 |
|
|
57
|
-
| `disable <module_name>` | 禁用指定模块 |
|
|
58
|
-
| `list [--module <module_name>]` | 列出所有模块或指定模块的详细信息 |
|
|
59
|
-
| `update` | 更新模块列表 |
|
|
60
|
-
| `upgrade [--force]` | 升级所有模块到最新版本 |
|
|
61
|
-
| `uninstall <module_name>` | 删除指定模块 |
|
|
62
|
-
| `install <module_name>` | 安装指定模块,支持多个模块 |
|
|
63
|
-
|
|
64
|
-
#### 模块源管理命令
|
|
65
|
-
|
|
66
|
-
| 命令 | 功能描述 |
|
|
67
|
-
|-------------------------------|------------------------------------|
|
|
68
|
-
| `origin add <url>` | 添加新的模块源 |
|
|
69
|
-
| `origin list` | 列出所有已配置的模块源 |
|
|
70
|
-
| `origin del <url>` | 删除指定的模块源 |
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
### 模块源
|
|
76
|
-
|
|
77
|
-
在使用 `ErisPulse` 时,模块源是管理模块的重要组成部分。根据不同的使用场景,模块源分为两种类型:**异步模块源** 和 **同步模块源**。以下是它们的详细说明:
|
|
78
|
-
|
|
79
|
-
#### 异步模块源
|
|
80
|
-
- URL 1: [https://github.com/wsu2059q/AsyncRBPS-Origin/raw/refs/heads/main/map.json](https://github.com/wsu2059q/AsyncRBPS-Origin/raw/refs/heads/main/map.json)
|
|
81
|
-
- URL 2: [https://sdkframe.anran.xyz/map.json](https://sdkframe.anran.xyz/map.json)
|
|
82
|
-
- 特性:
|
|
83
|
-
- 支持异步加载模块。
|
|
84
|
-
- 适用于需要高性能和非阻塞操作的场景。
|
|
85
|
-
- 推荐用于现代异步框架和应用。
|
|
86
|
-
|
|
87
|
-
#### 同步模块源
|
|
88
|
-
- URL: [https://runoneall.serv00.net/ryhsdk2/map.json](https://runoneall.serv00.net/ryhsdk2/map.json)
|
|
89
|
-
- 特性:
|
|
90
|
-
- 传统同步加载模块。
|
|
91
|
-
- 适用于兼容性要求较高的场景。
|
|
92
|
-
- 可能会在某些高并发场景下表现不如异步源。
|
|
93
|
-
|
|
94
|
-
#### 自定义模块源
|
|
95
|
-
用户可以搭建自己的模块源,以下是一个示例格式:
|
|
96
|
-
```json
|
|
97
|
-
{
|
|
98
|
-
"name": "Custom-Origin",
|
|
99
|
-
"base": "https://example.com/modules",
|
|
100
|
-
"modules": {
|
|
101
|
-
"CustomModule": {
|
|
102
|
-
"path": "/CustomModule.zip",
|
|
103
|
-
"version": "1.0.0",
|
|
104
|
-
"description": "自定义模块示例",
|
|
105
|
-
"author": "YourName",
|
|
106
|
-
"dependencies": [],
|
|
107
|
-
"optional_dependencies": []
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
#### 提供以下命令方便您快速添加源
|
|
114
|
-
```bash
|
|
115
|
-
# 添加异步模块源
|
|
116
|
-
python -m ErisPulse origin add https://github.com/wsu2059q/AsyncRBPS-Origin/raw/refs/heads/main/
|
|
117
|
-
# 添加同步模块源
|
|
118
|
-
python -m ErisPulse origin add https://runoneall.serv00.net/ryhsdk2/
|
|
119
|
-
|
|
120
|
-
# 添加自定义模块源
|
|
121
|
-
# python -m ErisPulse origin add https://example.com/modules/map.json - (map.json可省略,会自动搜索该文件)
|
|
122
|
-
|
|
123
|
-
# 查看当前配置的模块源
|
|
124
|
-
python -m ErisPulse origin list
|
|
125
|
-
|
|
126
|
-
# 更新模块列表
|
|
127
|
-
python -m ErisPulse update
|
|
128
|
-
```
|
erispulse-1.0.4/README.md
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
### 版本更新小通知~
|
|
2
|
-
- 此版本(1.0.4)修复了部分命令行不支持logger颜色代码的问题 | 替换为rich
|
|
3
|
-
|
|
4
|
-
# ErisPulse
|
|
5
|
-
|
|
6
|
-
本项目基于 [RyhBotPythonSDK V2](https://github.com/runoneall/RyhBotPythonSDK2) 构建,并由 [sdkFrame](https://github.com/runoneall/sdkFrame) 提供支持。这是一个异步版本的 SDK,可能在功能和特性上与原库存在一定差异。
|
|
7
|
-
|
|
8
|
-
ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
|
|
9
|
-
|
|
10
|
-
## 开发指南
|
|
11
|
-
|
|
12
|
-
项目的模块化设计允许开发者通过实现符合规范的模块快速扩展功能。模块的结构和接口规范可以参考 [开发指南](https://github.com/wsu2059q/ErisPulse/blob/main/%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97.md)。
|
|
13
|
-
|
|
14
|
-
### CLI命令介绍
|
|
15
|
-
|
|
16
|
-
`ErisPulse` 提供了丰富的 CLI 命令,用于管理模块、源和环境配置。以下是主要命令:
|
|
17
|
-
|
|
18
|
-
| 命令 | 功能描述 |
|
|
19
|
-
|-------------------------------|------------------------------------|
|
|
20
|
-
| `enable <module_name>` | 启用指定模块 |
|
|
21
|
-
| `disable <module_name>` | 禁用指定模块 |
|
|
22
|
-
| `list [--module <module_name>]` | 列出所有模块或指定模块的详细信息 |
|
|
23
|
-
| `update` | 更新模块列表 |
|
|
24
|
-
| `upgrade [--force]` | 升级所有模块到最新版本 |
|
|
25
|
-
| `uninstall <module_name>` | 删除指定模块 |
|
|
26
|
-
| `install <module_name>` | 安装指定模块,支持多个模块 |
|
|
27
|
-
|
|
28
|
-
#### 模块源管理命令
|
|
29
|
-
|
|
30
|
-
| 命令 | 功能描述 |
|
|
31
|
-
|-------------------------------|------------------------------------|
|
|
32
|
-
| `origin add <url>` | 添加新的模块源 |
|
|
33
|
-
| `origin list` | 列出所有已配置的模块源 |
|
|
34
|
-
| `origin del <url>` | 删除指定的模块源 |
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
### 模块源
|
|
40
|
-
|
|
41
|
-
在使用 `ErisPulse` 时,模块源是管理模块的重要组成部分。根据不同的使用场景,模块源分为两种类型:**异步模块源** 和 **同步模块源**。以下是它们的详细说明:
|
|
42
|
-
|
|
43
|
-
#### 异步模块源
|
|
44
|
-
- URL 1: [https://github.com/wsu2059q/AsyncRBPS-Origin/raw/refs/heads/main/map.json](https://github.com/wsu2059q/AsyncRBPS-Origin/raw/refs/heads/main/map.json)
|
|
45
|
-
- URL 2: [https://sdkframe.anran.xyz/map.json](https://sdkframe.anran.xyz/map.json)
|
|
46
|
-
- 特性:
|
|
47
|
-
- 支持异步加载模块。
|
|
48
|
-
- 适用于需要高性能和非阻塞操作的场景。
|
|
49
|
-
- 推荐用于现代异步框架和应用。
|
|
50
|
-
|
|
51
|
-
#### 同步模块源
|
|
52
|
-
- URL: [https://runoneall.serv00.net/ryhsdk2/map.json](https://runoneall.serv00.net/ryhsdk2/map.json)
|
|
53
|
-
- 特性:
|
|
54
|
-
- 传统同步加载模块。
|
|
55
|
-
- 适用于兼容性要求较高的场景。
|
|
56
|
-
- 可能会在某些高并发场景下表现不如异步源。
|
|
57
|
-
|
|
58
|
-
#### 自定义模块源
|
|
59
|
-
用户可以搭建自己的模块源,以下是一个示例格式:
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"name": "Custom-Origin",
|
|
63
|
-
"base": "https://example.com/modules",
|
|
64
|
-
"modules": {
|
|
65
|
-
"CustomModule": {
|
|
66
|
-
"path": "/CustomModule.zip",
|
|
67
|
-
"version": "1.0.0",
|
|
68
|
-
"description": "自定义模块示例",
|
|
69
|
-
"author": "YourName",
|
|
70
|
-
"dependencies": [],
|
|
71
|
-
"optional_dependencies": []
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
#### 提供以下命令方便您快速添加源
|
|
78
|
-
```bash
|
|
79
|
-
# 添加异步模块源
|
|
80
|
-
python -m ErisPulse origin add https://github.com/wsu2059q/AsyncRBPS-Origin/raw/refs/heads/main/
|
|
81
|
-
# 添加同步模块源
|
|
82
|
-
python -m ErisPulse origin add https://runoneall.serv00.net/ryhsdk2/
|
|
83
|
-
|
|
84
|
-
# 添加自定义模块源
|
|
85
|
-
# python -m ErisPulse origin add https://example.com/modules/map.json - (map.json可省略,会自动搜索该文件)
|
|
86
|
-
|
|
87
|
-
# 查看当前配置的模块源
|
|
88
|
-
python -m ErisPulse origin list
|
|
89
|
-
|
|
90
|
-
# 更新模块列表
|
|
91
|
-
python -m ErisPulse update
|
|
92
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|