ErisPulse 2.1.13rc2__py3-none-any.whl → 2.1.13rc3__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/__main__.py +38 -2
- {erispulse-2.1.13rc2.dist-info → erispulse-2.1.13rc3.dist-info}/METADATA +1 -1
- {erispulse-2.1.13rc2.dist-info → erispulse-2.1.13rc3.dist-info}/RECORD +6 -6
- {erispulse-2.1.13rc2.dist-info → erispulse-2.1.13rc3.dist-info}/WHEEL +0 -0
- {erispulse-2.1.13rc2.dist-info → erispulse-2.1.13rc3.dist-info}/entry_points.txt +0 -0
- {erispulse-2.1.13rc2.dist-info → erispulse-2.1.13rc3.dist-info}/licenses/LICENSE +0 -0
ErisPulse/__main__.py
CHANGED
|
@@ -329,7 +329,7 @@ class PackageManager:
|
|
|
329
329
|
|
|
330
330
|
:raises KeyboardInterrupt: 用户取消操作时抛出
|
|
331
331
|
"""
|
|
332
|
-
installed = self.
|
|
332
|
+
installed = self.get_installed_packages()
|
|
333
333
|
all_packages = set()
|
|
334
334
|
|
|
335
335
|
for pkg_type in ["modules", "adapters", "cli_extensions"]:
|
|
@@ -652,6 +652,22 @@ class CLI:
|
|
|
652
652
|
|
|
653
653
|
return parser
|
|
654
654
|
|
|
655
|
+
def _get_external_commands(self) -> List[str]:
|
|
656
|
+
"""
|
|
657
|
+
获取所有已注册的第三方命令名称
|
|
658
|
+
|
|
659
|
+
:return: 第三方命令名称列表
|
|
660
|
+
"""
|
|
661
|
+
try:
|
|
662
|
+
entry_points = importlib.metadata.entry_points()
|
|
663
|
+
if hasattr(entry_points, 'select'):
|
|
664
|
+
cli_entries = entry_points.select(group='erispulse.cli')
|
|
665
|
+
else:
|
|
666
|
+
cli_entries = entry_points.get('erispulse.cli', [])
|
|
667
|
+
return [entry.name for entry in cli_entries]
|
|
668
|
+
except Exception:
|
|
669
|
+
return []
|
|
670
|
+
|
|
655
671
|
def _load_external_commands(self, subparsers):
|
|
656
672
|
"""
|
|
657
673
|
加载第三方CLI命令
|
|
@@ -1027,9 +1043,29 @@ class CLI:
|
|
|
1027
1043
|
|
|
1028
1044
|
elif args.command == "init":
|
|
1029
1045
|
from ErisPulse import sdk
|
|
1030
|
-
sdk.init(
|
|
1046
|
+
sdk.init()
|
|
1031
1047
|
console.print("[success]ErisPulse项目初始化完成[/]")
|
|
1032
1048
|
|
|
1049
|
+
# 处理第三方命令
|
|
1050
|
+
elif args.command in self._get_external_commands():
|
|
1051
|
+
# 获取第三方命令的处理函数并执行
|
|
1052
|
+
entry_points = importlib.metadata.entry_points()
|
|
1053
|
+
if hasattr(entry_points, 'select'):
|
|
1054
|
+
cli_entries = entry_points.select(group='erispulse.cli')
|
|
1055
|
+
else:
|
|
1056
|
+
cli_entries = entry_points.get('erispulse.cli', [])
|
|
1057
|
+
|
|
1058
|
+
for entry in cli_entries:
|
|
1059
|
+
if entry.name == args.command:
|
|
1060
|
+
cli_func = entry.load()
|
|
1061
|
+
if callable(cli_func):
|
|
1062
|
+
# 创建一个新的解析器来解析第三方命令的参数
|
|
1063
|
+
subparser = self.parser._subparsers._group_actions[0].choices[args.command]
|
|
1064
|
+
parsed_args = subparser.parse_args(sys.argv[2:])
|
|
1065
|
+
# 调用第三方命令处理函数
|
|
1066
|
+
parsed_args.func(parsed_args)
|
|
1067
|
+
break
|
|
1068
|
+
|
|
1033
1069
|
except KeyboardInterrupt:
|
|
1034
1070
|
console.print("\n[warning]操作被用户中断[/]")
|
|
1035
1071
|
self._cleanup()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
ErisPulse/__init__.py,sha256=T-N56UQyBmpvlqwH2wGi5ptPzaJpbgF5tKkJt0DlkaM,26099
|
|
2
|
-
ErisPulse/__main__.py,sha256=
|
|
2
|
+
ErisPulse/__main__.py,sha256=kGpk-BeztjhrdNwWL2mZxaVy05y4XicCS6SZGtQERho,37409
|
|
3
3
|
ErisPulse/Core/__init__.py,sha256=tBYPahQ7-w7U6M69xy8DW0_ECa9ja-Q0y_SQqVswYBo,409
|
|
4
4
|
ErisPulse/Core/adapter.py,sha256=ZK81dibJ471FowL0MRXkS113iBcMgj_VzpTw0PzhAEo,18102
|
|
5
5
|
ErisPulse/Core/config.py,sha256=ZmwGdtHSOE7K5uOGzLYcyl3ZF3sAmeWAntqcdfDzhpM,5027
|
|
@@ -9,8 +9,8 @@ ErisPulse/Core/mods.py,sha256=2yIq8t9Ca9CBPRiZU0yr8Lc0XGmmkB7LlH-5FWqXjw4,7023
|
|
|
9
9
|
ErisPulse/Core/raiserr.py,sha256=vlyaaiOIYkyqm9dAqSW9E54JBzX-9roHDp5_r6I0yUU,5591
|
|
10
10
|
ErisPulse/Core/server.py,sha256=FkDTeLuHD5IBnWVxvYU8pHb6yCt8GzyvC1bpOiJ7G7I,9217
|
|
11
11
|
ErisPulse/Core/util.py,sha256=7rdMmn6sBFqYd4znxBCcJjuv2eyTExdeKyZopgds868,3796
|
|
12
|
-
erispulse-2.1.
|
|
13
|
-
erispulse-2.1.
|
|
14
|
-
erispulse-2.1.
|
|
15
|
-
erispulse-2.1.
|
|
16
|
-
erispulse-2.1.
|
|
12
|
+
erispulse-2.1.13rc3.dist-info/METADATA,sha256=ppMW2h_uDFhvpfP9u30vbaHgQA9fr_oPdDzeWaLQRf4,6262
|
|
13
|
+
erispulse-2.1.13rc3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
14
|
+
erispulse-2.1.13rc3.dist-info/entry_points.txt,sha256=Jss71M6nEha0TA-DyVZugPYdcL14s9QpiOeIlgWxzOc,182
|
|
15
|
+
erispulse-2.1.13rc3.dist-info/licenses/LICENSE,sha256=4jyqikiB0G0n06CEEMMTzTXjE4IShghSlB74skMSPQs,1464
|
|
16
|
+
erispulse-2.1.13rc3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|