ErisPulse 1.0.5__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.
@@ -6,35 +6,45 @@ import aiohttp
6
6
  import zipfile
7
7
  import asyncio
8
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
9
15
  from .envManager import env
10
16
  from .origin import origin_manager
11
17
 
18
+ console = Console()
19
+
12
20
  def enable_module(module_name):
13
21
  module_info = env.get_module(module_name)
14
22
  if module_info:
15
23
  env.set_module_status(module_name, True)
16
- print(f"模块 {module_name} 已启用")
24
+ console.print(f"[green]模块 {module_name} 已启用[/green]")
17
25
  else:
18
- print(f"模块 {module_name} 不存在")
26
+ console.print(f"[red]模块 {module_name} 不存在[/red]")
19
27
 
20
28
  def disable_module(module_name):
21
29
  module_info = env.get_module(module_name)
22
30
  if module_info:
23
31
  env.set_module_status(module_name, False)
24
- print(f"模块 {module_name} 已禁用")
32
+ console.print(f"[yellow]模块 {module_name} 已禁用[/yellow]")
25
33
  else:
26
- print(f"模块 {module_name} 不存在")
34
+ console.print(f"[red]模块 {module_name} 不存在[/red]")
35
+
27
36
  async def fetch_url(session, url):
28
37
  try:
29
38
  async with session.get(url) as response:
30
39
  response.raise_for_status()
31
40
  return await response.read()
32
41
  except Exception as e:
33
- print(f"请求失败: {e}")
42
+ console.print(f"[red]请求失败: {e}[/red]")
34
43
  return None
44
+
35
45
  def extract_and_setup_module(module_name, module_url, zip_path, module_dir):
36
46
  try:
37
- print(f"正在从 {module_url} 下载模块...")
47
+ console.print(f"[cyan]正在从 {module_url} 下载模块...[/cyan]")
38
48
 
39
49
  async def download_module():
40
50
  async with aiohttp.ClientSession() as session:
@@ -65,18 +75,18 @@ def extract_and_setup_module(module_name, module_url, zip_path, module_dir):
65
75
  shutil.move(source_item, module_dir)
66
76
  os.rmdir(sub_dir)
67
77
 
68
- print(f"模块 {module_name} 文件已成功解压并设置")
78
+ console.print(f"[green]模块 {module_name} 文件已成功解压并设置[/green]")
69
79
  return True
70
80
 
71
81
  return asyncio.run(download_module())
72
82
 
73
83
  except Exception as e:
74
- print(f"处理模块 {module_name} 文件失败: {e}")
84
+ console.print(Panel(f"[red]处理模块 {module_name} 文件失败: {e}[/red]", title="错误", border_style="red"))
75
85
  if os.path.exists(zip_path):
76
86
  try:
77
87
  os.remove(zip_path)
78
88
  except Exception as cleanup_error:
79
- print(f"清理失败: {cleanup_error}")
89
+ console.print(f"[red]清理失败: {cleanup_error}[/red]")
80
90
  return False
81
91
 
82
92
  finally:
@@ -84,14 +94,13 @@ def extract_and_setup_module(module_name, module_url, zip_path, module_dir):
84
94
  try:
85
95
  os.remove(zip_path)
86
96
  except Exception as cleanup_error:
87
- print(f"清理失败: {cleanup_error}")
88
-
97
+ console.print(f"[red]清理失败: {cleanup_error}[/red]")
89
98
 
90
99
  def install_pip_dependencies(dependencies):
91
100
  if not dependencies:
92
101
  return True
93
102
 
94
- print("正在安装pip依赖...")
103
+ console.print("[cyan]正在安装pip依赖...[/cyan]")
95
104
  try:
96
105
  result = subprocess.run(
97
106
  [sys.executable, "-m", "pip", "install"] + dependencies,
@@ -99,16 +108,16 @@ def install_pip_dependencies(dependencies):
99
108
  stdout=subprocess.PIPE,
100
109
  stderr=subprocess.PIPE
101
110
  )
102
- print(result.stdout.decode())
111
+ console.print(result.stdout.decode())
103
112
  return True
104
113
  except subprocess.CalledProcessError as e:
105
- print(f"安装pip依赖失败: {e.stderr.decode()}")
114
+ console.print(Panel(f"[red]安装pip依赖失败: {e.stderr.decode()}[/red]", title="错误", border_style="red"))
106
115
  return False
107
116
 
108
117
  def install_module(module_name, force=False):
109
118
  module_info = env.get_module(module_name)
110
119
  if module_info and not force:
111
- print(f"模块 {module_name} 已存在,使用 --force 参数强制重装")
120
+ console.print(f"[yellow]模块 {module_name} 已存在,使用 --force 参数强制重装[/yellow]")
112
121
  return
113
122
 
114
123
  providers = env.get('providers', {})
@@ -137,41 +146,40 @@ def install_module(module_name, force=False):
137
146
  })
138
147
 
139
148
  if not module_info:
140
- print(f"未找到模块 {module_name}")
149
+ console.print(f"[red]未找到模块 {module_name}[/red]")
141
150
  return
142
151
 
143
152
  if len(module_info) > 1:
144
- 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")
145
160
  for i, info in enumerate(module_info):
146
- print(f"{i+1}. 源: {info['provider']}")
147
- print(f" 版本: {info['version']}")
148
- print(f" 描述: {info['description']}")
149
- print(f" 作者: {info['author']}")
150
- print(f" 依赖: {', '.join(info['dependencies']) if info['dependencies'] else '无'}")
151
- print()
161
+ table.add_row(str(i+1), info['provider'], info['version'], info['description'], info['author'])
162
+ console.print(table)
152
163
 
153
164
  while True:
154
- try:
155
- choice = int(input("请选择要安装的源 (输入编号): "))
156
- if 1 <= choice <= len(module_info):
157
- selected_module = module_info[choice-1]
158
- break
159
- else:
160
- print("输入无效,请重新选择")
161
- except ValueError:
162
- 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]")
163
171
  else:
164
172
  selected_module = module_info[0]
165
173
 
166
174
  for dep in selected_module['dependencies']:
167
- print(f"正在安装依赖模块 {dep}...")
175
+ console.print(f"[cyan]正在安装依赖模块 {dep}...[/cyan]")
168
176
  install_module(dep)
169
177
 
170
178
  third_party_deps = selected_module.get('pip_dependencies', [])
171
179
  if third_party_deps:
172
- print(f"模块 {module_name} 需要以下pip依赖: {', '.join(third_party_deps)}")
180
+ console.print(f"[cyan]模块 {module_name} 需要以下pip依赖: {', '.join(third_party_deps)}[/cyan]")
173
181
  if not install_pip_dependencies(third_party_deps):
174
- print(f"无法安装模块 {module_name} 的pip依赖,安装终止")
182
+ console.print(f"[red]无法安装模块 {module_name} 的pip依赖,安装终止[/red]")
175
183
  return
176
184
 
177
185
  module_url = selected_module['url'] + selected_module['path']
@@ -198,7 +206,7 @@ def install_module(module_name, force=False):
198
206
  'pip_dependencies': selected_module['pip_dependencies']
199
207
  }
200
208
  })
201
- print(f"模块 {module_name} 安装成功")
209
+ console.print(f"[green]模块 {module_name} 安装成功[/green]")
202
210
 
203
211
  def uninstall_module(module_name):
204
212
  script_dir = os.path.dirname(os.path.abspath(__file__))
@@ -209,25 +217,65 @@ def uninstall_module(module_name):
209
217
  try:
210
218
  os.remove(module_file_path)
211
219
  except Exception as e:
212
- print(f"删除模块文件 {module_name} 时出错: {e}")
220
+ console.print(f"[red]删除模块文件 {module_name} 时出错: {e}[/red]")
213
221
  elif os.path.exists(module_path) and os.path.isdir(module_path):
214
222
  try:
215
223
  shutil.rmtree(module_path)
216
224
  except Exception as e:
217
- print(f"删除模块目录 {module_name} 时出错: {e}")
225
+ console.print(f"[red]删除模块目录 {module_name} 时出错: {e}[/red]")
218
226
  else:
219
- 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]")
220
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'}
241
+
242
+ for dep in pip_dependencies:
243
+ if dep in essential_packages:
244
+ console.print(f"[yellow]跳过必要模块 {dep} 的卸载[/yellow]")
245
+ continue
221
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
+
222
271
  if env.remove_module(module_name):
223
- print(f"模块 {module_name} 已删除")
272
+ console.print(f"[green]模块 {module_name} 已删除[/green]")
224
273
  else:
225
- print(f"模块 {module_name} 不存在")
226
-
274
+ console.print(f"[red]模块 {module_name} 不存在[/red]")
227
275
  def upgrade_all_modules(force=False):
228
276
  all_modules = env.get_all_modules()
229
277
  if not all_modules:
230
- print("未找到任何模块,无法更新")
278
+ console.print("[yellow]未找到任何模块,无法更新[/yellow]")
231
279
  return
232
280
 
233
281
  providers = env.get('providers', {})
@@ -257,26 +305,27 @@ def upgrade_all_modules(force=False):
257
305
  })
258
306
 
259
307
  if not updates_available:
260
- print("所有模块已是最新版本,无需更新")
308
+ console.print("[green]所有模块已是最新版本,无需更新[/green]")
261
309
  return
262
310
 
263
- 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")
264
317
  for update in updates_available:
265
- print(f"模块: {update['name']}")
266
- print(f"当前版本: {update['local_version']}")
267
- print(f"最新版本: {update['remote_version']}")
268
- print(f"源: {update['provider']}")
269
- print()
318
+ table.add_row(update['name'], update['local_version'], update['remote_version'], update['provider'])
319
+ console.print(table)
270
320
 
271
321
  if not force:
272
- confirm = input("\033[93m\033[1m警告:更新模块可能会导致兼容性问题,请在更新前查看插件作者的相关声明。\n"
273
- "是否继续?(y/n): \033[0m").strip().lower()
274
- if confirm != 'y':
275
- print("更新已取消")
322
+ confirm = Confirm.ask("[yellow]警告:更新模块可能会导致兼容性问题,请在更新前查看插件作者的相关声明。\n是否继续?[/yellow]", default=False)
323
+ if not confirm:
324
+ console.print("[yellow]更新已取消[/yellow]")
276
325
  return
277
326
 
278
327
  for update in updates_available:
279
- print(f"正在更新模块 {update['name']}...")
328
+ console.print(f"[cyan]正在更新模块 {update['name']}...[/cyan]")
280
329
  module_url = update['url'] + update['path']
281
330
  script_dir = os.path.dirname(os.path.abspath(__file__))
282
331
  module_dir = os.path.join(script_dir, 'modules', update['name'])
@@ -292,68 +341,46 @@ def upgrade_all_modules(force=False):
292
341
 
293
342
  all_modules[update['name']]['info']['version'] = update['remote_version']
294
343
  env.set_all_modules(all_modules)
295
- print(f"模块 {update['name']} 已更新至版本 {update['remote_version']}")
344
+ console.print(f"[green]模块 {update['name']} 已更新至版本 {update['remote_version']}[/green]")
296
345
 
297
- def list_modules(module_name=None, page_size=5):
346
+ def list_modules(module_name=None):
298
347
  all_modules = env.get_all_modules()
299
348
  if not all_modules:
300
- print("正在初始化模块列表...")
349
+ console.print("[yellow]未在数据库中发现注册模块,正在初始化模块列表...[/yellow]")
301
350
  from . import init as init_module
302
351
  init_module()
303
352
  all_modules = env.get_all_modules()
304
-
305
- modules = [{"name": name, **info} for name, info in all_modules.items()]
306
-
307
- if module_name:
308
- module = next((m for m in modules if m['name'] == module_name), None)
309
- if module:
310
- status = "启用" if module.get("status", True) else "禁用"
311
- print(f"模块: {module['name']}")
312
- print(f"状态: {status}")
313
- print(f"版本: {module['info'].get('version', '未知')}")
314
- print(f"描述: {module['info'].get('description', '无描述')}")
315
- print(f"作者: {module['info'].get('author', '未知')}")
316
- print(f"依赖: {', '.join(module['info'].get('dependencies', [])) if module['info'].get('dependencies') else '无'}")
317
- else:
318
- print(f"模块 {module_name} 不存在")
319
- else:
320
- total_modules = len(modules)
321
- total_pages = (total_modules + page_size - 1) // page_size
322
- current_page = 1
323
353
 
324
- try:
325
- while True:
326
- print("\033c", end="")
327
-
328
- start_index = (current_page - 1) * page_size
329
- end_index = min(start_index + page_size, total_modules)
330
- print(f"\n--- 模块列表 (第 {current_page}/{total_pages} 页) ---")
331
-
332
- for i in range(start_index, end_index):
333
- module = modules[i]
334
- status = "启用" if module.get("status", True) else "禁用"
335
- dependencies = ', '.join(module['info'].get('dependencies', [])) if module['info'].get('dependencies') else '无'
336
- print(f"{i+1}. 模块: {module['name']} | 状态: {status} | 版本: {module['info'].get('version', '未知')}")
337
- print(f" 描述: {module['info'].get('description', '无描述')}")
338
- print(f" 依赖: {dependencies}\n")
339
-
340
- print("\n输入页码直接跳转,或输入 'e' 下一页, 'q' 上一页 | 使用 Ctrl+C 退出")
341
- user_input = input("> ").strip().lower()
342
- if user_input.isdigit():
343
- target_page = int(user_input)
344
- if target_page < 1:
345
- current_page = 1
346
- elif target_page > total_pages:
347
- current_page = total_pages
348
- else:
349
- current_page = target_page
350
- elif user_input == 'e' and current_page < total_pages:
351
- current_page += 1
352
- elif user_input == 'q' and current_page > 1:
353
- current_page -= 1
354
- except KeyboardInterrupt:
355
- print("\n")
356
- 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
+
357
384
  def main():
358
385
  parser = argparse.ArgumentParser(
359
386
  description="ErisPulse 命令行工具",
@@ -370,7 +397,6 @@ def main():
370
397
  disable_parser.add_argument('--init', action='store_true', help='在禁用模块前初始化模块数据库')
371
398
 
372
399
  list_parser = subparsers.add_parser('list', help='列出所有模块信息')
373
- list_parser.add_argument('--init', action='store_true', help='在列出模块前初始化模块数据库')
374
400
  list_parser.add_argument('--module', '-m', type=str, help='指定要展示的模块名称')
375
401
 
376
402
  update_parser = subparsers.add_parser('update', help='更新模块列表')
@@ -400,7 +426,7 @@ def main():
400
426
  args = parser.parse_args()
401
427
 
402
428
  if hasattr(args, 'init') and args.init:
403
- print("正在初始化模块列表...")
429
+ console.print("[yellow]正在初始化模块列表...[/yellow]")
404
430
  from . import init as init_module
405
431
  init_module()
406
432
 
@@ -6,7 +6,7 @@ from pathlib import Path
6
6
 
7
7
  class EnvManager:
8
8
  _instance = None
9
- db_path = "./config.db"
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, dependencies, optional_dependencies
117
- ) VALUES (?, ?, ?, ?, ?, ?, ?)
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, dependencies, optional_dependencies
174
- ) VALUES (?, ?, ?, ?, ?, ?, ?)
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调整为包内存储,以解决多进程问题
@@ -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调整为包内存储,以解决多进程问题
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='ErisPulse',
5
- version='1.0.5',
5
+ version='1.0.6',
6
6
  author='艾莉丝·格雷拉特(WSu2059)',
7
7
  author_email='wsu2059@qq.com',
8
8
  maintainer='runoneall',
@@ -1,128 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: ErisPulse
3
- Version: 1.0.5
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.5)更新了模块对于pip依赖安装的支持
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.5/PKG-INFO DELETED
@@ -1,128 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: ErisPulse
3
- Version: 1.0.5
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.5)更新了模块对于pip依赖安装的支持
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.5/README.md DELETED
@@ -1,92 +0,0 @@
1
- ### 版本更新小通知~
2
- - 此版本(1.0.5)更新了模块对于pip依赖安装的支持
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