ErisPulse 2.3.4.dev0__py3-none-any.whl → 2.3.4.dev2__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/{utils/cli → CLI}/__init__.py +1 -1
- ErisPulse/{utils/cli → CLI}/__init__.pyi +1 -1
- ErisPulse/{utils/cli/__main__.py → CLI/cli.py} +3 -4
- ErisPulse/{utils/cli/__main__.pyi → CLI/cli.pyi} +2 -3
- ErisPulse/{utils/cli → CLI}/commands/init.py +4 -9
- ErisPulse/{utils/cli → CLI}/commands/init.pyi +2 -14
- ErisPulse/{utils/cli → CLI}/commands/install.py +2 -7
- ErisPulse/{utils/cli → CLI}/commands/install.pyi +2 -14
- ErisPulse/{utils/cli → CLI}/commands/list.py +2 -7
- ErisPulse/{utils/cli → CLI}/commands/list.pyi +2 -14
- ErisPulse/{utils/cli → CLI}/commands/list_remote.py +2 -7
- ErisPulse/{utils/cli → CLI}/commands/list_remote.pyi +2 -14
- ErisPulse/{utils/cli → CLI}/commands/run.py +3 -7
- ErisPulse/{utils/cli → CLI}/commands/run.pyi +2 -11
- ErisPulse/{utils/cli → CLI}/commands/self_update.py +2 -7
- ErisPulse/{utils/cli → CLI}/commands/self_update.pyi +2 -14
- ErisPulse/{utils/cli → CLI}/commands/uninstall.py +1 -6
- ErisPulse/{utils/cli → CLI}/commands/uninstall.pyi +1 -14
- ErisPulse/{utils/cli → CLI}/commands/upgrade.py +1 -7
- ErisPulse/{utils/cli → CLI}/commands/upgrade.pyi +1 -14
- ErisPulse/{utils → CLI/utils}/__init__.py +1 -5
- ErisPulse/{utils → CLI/utils}/__init__.pyi +0 -2
- ErisPulse/{utils → CLI/utils}/package_manager.py +146 -20
- ErisPulse/{utils → CLI/utils}/package_manager.pyi +20 -3
- ErisPulse/{utils → CLI/utils}/reload_handler.py +7 -8
- ErisPulse/{utils → CLI/utils}/reload_handler.pyi +1 -1
- ErisPulse/Core/Bases/manager.py +136 -0
- ErisPulse/Core/Bases/manager.pyi +108 -0
- ErisPulse/Core/Bases/module.py +53 -1
- ErisPulse/Core/Bases/module.pyi +43 -0
- ErisPulse/Core/Event/command.py +6 -1
- ErisPulse/Core/_self_config.py +1 -1
- ErisPulse/Core/adapter.py +70 -10
- ErisPulse/Core/adapter.pyi +18 -1
- ErisPulse/Core/exceptions.py +4 -2
- ErisPulse/Core/lifecycle.py +9 -0
- ErisPulse/Core/logger.py +21 -15
- ErisPulse/Core/logger.pyi +2 -1
- ErisPulse/Core/module.py +57 -9
- ErisPulse/Core/module.pyi +12 -1
- ErisPulse/Core/router.py +13 -5
- ErisPulse/Core/storage.py +94 -256
- ErisPulse/Core/storage.pyi +13 -66
- ErisPulse/__init__.py +35 -1237
- ErisPulse/__init__.pyi +3 -290
- ErisPulse/__main__.py +1 -1
- ErisPulse/__main__.pyi +1 -1
- ErisPulse/loaders/__init__.py +22 -0
- ErisPulse/loaders/__init__.pyi +21 -0
- ErisPulse/loaders/adapter_loader.py +187 -0
- ErisPulse/loaders/adapter_loader.pyi +82 -0
- ErisPulse/loaders/base_loader.py +162 -0
- ErisPulse/loaders/base_loader.pyi +23 -0
- ErisPulse/loaders/initializer.py +150 -0
- ErisPulse/loaders/initializer.pyi +60 -0
- ErisPulse/loaders/module_loader.py +618 -0
- ErisPulse/loaders/module_loader.pyi +179 -0
- ErisPulse/loaders/strategy.py +129 -0
- ErisPulse/loaders/strategy.pyi +90 -0
- ErisPulse/sdk.py +435 -0
- ErisPulse/sdk.pyi +158 -0
- {erispulse-2.3.4.dev0.dist-info → erispulse-2.3.4.dev2.dist-info}/METADATA +1 -1
- erispulse-2.3.4.dev2.dist-info/RECORD +103 -0
- ErisPulse/sdk_protocol.py +0 -143
- ErisPulse/sdk_protocol.pyi +0 -97
- erispulse-2.3.4.dev0.dist-info/RECORD +0 -89
- /ErisPulse/{utils/cli → CLI}/base.py +0 -0
- /ErisPulse/{utils/cli → CLI}/base.pyi +0 -0
- /ErisPulse/{utils/cli → CLI}/commands/__init__.py +0 -0
- /ErisPulse/{utils/cli → CLI}/commands/__init__.pyi +0 -0
- /ErisPulse/{utils → CLI}/console.py +0 -0
- /ErisPulse/{utils → CLI}/console.pyi +0 -0
- /ErisPulse/{utils/cli → CLI}/registry.py +0 -0
- /ErisPulse/{utils/cli → CLI}/registry.pyi +0 -0
- {erispulse-2.3.4.dev0.dist-info → erispulse-2.3.4.dev2.dist-info}/WHEEL +0 -0
- {erispulse-2.3.4.dev0.dist-info → erispulse-2.3.4.dev2.dist-info}/entry_points.txt +0 -0
- {erispulse-2.3.4.dev0.dist-info → erispulse-2.3.4.dev2.dist-info}/licenses/LICENSE +0 -0
|
@@ -10,12 +10,11 @@ import importlib.metadata
|
|
|
10
10
|
import asyncio
|
|
11
11
|
import traceback
|
|
12
12
|
import pkgutil
|
|
13
|
-
from pathlib import Path
|
|
14
13
|
from argparse import ArgumentParser, RawDescriptionHelpFormatter
|
|
15
14
|
|
|
16
15
|
from rich.panel import Panel
|
|
17
16
|
|
|
18
|
-
from
|
|
17
|
+
from .console import console
|
|
19
18
|
from .registry import CommandRegistry
|
|
20
19
|
from .base import Command
|
|
21
20
|
|
|
@@ -43,7 +42,7 @@ class CLI:
|
|
|
43
42
|
parser = ArgumentParser(
|
|
44
43
|
prog="epsdk",
|
|
45
44
|
formatter_class=RawDescriptionHelpFormatter,
|
|
46
|
-
description="ErisPulse SDK
|
|
45
|
+
description="ErisPulse SDK 命令行工具",
|
|
47
46
|
)
|
|
48
47
|
parser._positionals.title = "命令"
|
|
49
48
|
parser._optionals.title = "选项"
|
|
@@ -79,7 +78,7 @@ class CLI:
|
|
|
79
78
|
并自动注册到命令注册表中。
|
|
80
79
|
"""
|
|
81
80
|
# 获取 commands 包的路径
|
|
82
|
-
commands_package = 'ErisPulse.
|
|
81
|
+
commands_package = 'ErisPulse.CLI.commands'
|
|
83
82
|
|
|
84
83
|
try:
|
|
85
84
|
# 遍历 commands 包中的所有模块
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# type: ignore
|
|
2
2
|
#
|
|
3
|
-
# Auto-generated type stub for
|
|
3
|
+
# Auto-generated type stub for cli.py
|
|
4
4
|
# DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
|
|
5
5
|
#
|
|
6
6
|
|
|
@@ -16,10 +16,9 @@ import importlib.metadata
|
|
|
16
16
|
import asyncio
|
|
17
17
|
import traceback
|
|
18
18
|
import pkgutil
|
|
19
|
-
from pathlib import Path
|
|
20
19
|
from argparse import ArgumentParser, RawDescriptionHelpFormatter
|
|
21
20
|
from rich.panel import Panel
|
|
22
|
-
from
|
|
21
|
+
from .console import console
|
|
23
22
|
from .registry import CommandRegistry
|
|
24
23
|
from .base import Command
|
|
25
24
|
|
|
@@ -12,23 +12,19 @@ from argparse import ArgumentParser
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
from rich.prompt import Confirm, Prompt
|
|
14
14
|
|
|
15
|
-
from
|
|
16
|
-
from
|
|
15
|
+
from ..console import console
|
|
16
|
+
from ..utils import PackageManager
|
|
17
17
|
from ..base import Command
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class InitCommand(Command):
|
|
21
|
-
"""初始化命令"""
|
|
22
|
-
|
|
23
21
|
name = "init"
|
|
24
|
-
description = "
|
|
22
|
+
description = "初始化 ErisPulse 项目"
|
|
25
23
|
|
|
26
24
|
def __init__(self):
|
|
27
|
-
"""初始化命令"""
|
|
28
25
|
self.package_manager = PackageManager()
|
|
29
26
|
|
|
30
27
|
def add_arguments(self, parser: ArgumentParser):
|
|
31
|
-
"""添加命令参数"""
|
|
32
28
|
parser.add_argument(
|
|
33
29
|
'--project-name', '-n',
|
|
34
30
|
help='项目名称 (可选,交互式初始化时将会询问)'
|
|
@@ -45,7 +41,6 @@ class InitCommand(Command):
|
|
|
45
41
|
)
|
|
46
42
|
|
|
47
43
|
def execute(self, args):
|
|
48
|
-
"""执行命令"""
|
|
49
44
|
if args.quick and args.project_name:
|
|
50
45
|
# 快速模式:只创建项目,不进行交互配置
|
|
51
46
|
success = self._init_project(args.project_name, [])
|
|
@@ -263,7 +258,7 @@ class InitCommand(Command):
|
|
|
263
258
|
:param adapter_names: 适配器名称列表
|
|
264
259
|
:param adapters_info: 适配器信息字典
|
|
265
260
|
"""
|
|
266
|
-
from
|
|
261
|
+
from ..utils import PackageManager
|
|
267
262
|
pkg_manager = PackageManager()
|
|
268
263
|
|
|
269
264
|
for adapter_name in adapter_names:
|
|
@@ -17,28 +17,16 @@ import sys
|
|
|
17
17
|
from argparse import ArgumentParser
|
|
18
18
|
from pathlib import Path
|
|
19
19
|
from rich.prompt import Confirm, Prompt
|
|
20
|
-
from
|
|
21
|
-
from
|
|
20
|
+
from ..console import console
|
|
21
|
+
from ..utils import PackageManager
|
|
22
22
|
from ..base import Command
|
|
23
23
|
|
|
24
24
|
class InitCommand(Command):
|
|
25
|
-
"""
|
|
26
|
-
初始化命令
|
|
27
|
-
"""
|
|
28
25
|
def __init__(self: None) -> ...:
|
|
29
|
-
"""
|
|
30
|
-
初始化命令
|
|
31
|
-
"""
|
|
32
26
|
...
|
|
33
27
|
def add_arguments(self: object, parser: ArgumentParser) -> ...:
|
|
34
|
-
"""
|
|
35
|
-
添加命令参数
|
|
36
|
-
"""
|
|
37
28
|
...
|
|
38
29
|
def execute(self: object, args: ...) -> ...:
|
|
39
|
-
"""
|
|
40
|
-
执行命令
|
|
41
|
-
"""
|
|
42
30
|
...
|
|
43
31
|
def _init_project(self: object, project_name: str, adapter_list: list = ...) -> bool:
|
|
44
32
|
"""
|
|
@@ -13,23 +13,19 @@ from rich.prompt import Confirm, Prompt
|
|
|
13
13
|
from rich.table import Table
|
|
14
14
|
from rich.box import SIMPLE
|
|
15
15
|
|
|
16
|
-
from
|
|
17
|
-
from
|
|
16
|
+
from ..utils import PackageManager
|
|
17
|
+
from ..console import console
|
|
18
18
|
from ..base import Command
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class InstallCommand(Command):
|
|
22
|
-
"""安装命令"""
|
|
23
|
-
|
|
24
22
|
name = "install"
|
|
25
23
|
description = "安装模块/适配器包(不指定包名时进入交互式安装)"
|
|
26
24
|
|
|
27
25
|
def __init__(self):
|
|
28
|
-
"""初始化命令"""
|
|
29
26
|
self.package_manager = PackageManager()
|
|
30
27
|
|
|
31
28
|
def add_arguments(self, parser: ArgumentParser):
|
|
32
|
-
"""添加命令参数"""
|
|
33
29
|
parser.add_argument(
|
|
34
30
|
'package',
|
|
35
31
|
nargs='*',
|
|
@@ -47,7 +43,6 @@ class InstallCommand(Command):
|
|
|
47
43
|
)
|
|
48
44
|
|
|
49
45
|
def execute(self, args):
|
|
50
|
-
"""执行命令"""
|
|
51
46
|
if args.package:
|
|
52
47
|
# 批量安装
|
|
53
48
|
success = self.package_manager.install_package(
|
|
@@ -17,28 +17,16 @@ from rich.panel import Panel
|
|
|
17
17
|
from rich.prompt import Confirm, Prompt
|
|
18
18
|
from rich.table import Table
|
|
19
19
|
from rich.box import SIMPLE
|
|
20
|
-
from
|
|
21
|
-
from
|
|
20
|
+
from ..utils import PackageManager
|
|
21
|
+
from ..console import console
|
|
22
22
|
from ..base import Command
|
|
23
23
|
|
|
24
24
|
class InstallCommand(Command):
|
|
25
|
-
"""
|
|
26
|
-
安装命令
|
|
27
|
-
"""
|
|
28
25
|
def __init__(self: None) -> ...:
|
|
29
|
-
"""
|
|
30
|
-
初始化命令
|
|
31
|
-
"""
|
|
32
26
|
...
|
|
33
27
|
def add_arguments(self: object, parser: ArgumentParser) -> ...:
|
|
34
|
-
"""
|
|
35
|
-
添加命令参数
|
|
36
|
-
"""
|
|
37
28
|
...
|
|
38
29
|
def execute(self: object, args: ...) -> ...:
|
|
39
|
-
"""
|
|
40
|
-
执行命令
|
|
41
|
-
"""
|
|
42
30
|
...
|
|
43
31
|
def _interactive_install(self: object, upgrade: bool = ..., pre: bool = ...) -> ...:
|
|
44
32
|
"""
|
|
@@ -10,23 +10,19 @@ from argparse import ArgumentParser
|
|
|
10
10
|
from rich.table import Table
|
|
11
11
|
from rich.box import SIMPLE
|
|
12
12
|
|
|
13
|
-
from
|
|
14
|
-
from
|
|
13
|
+
from ..utils import PackageManager
|
|
14
|
+
from ..console import console
|
|
15
15
|
from ..base import Command
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class ListCommand(Command):
|
|
19
|
-
"""列表命令"""
|
|
20
|
-
|
|
21
19
|
name = "list"
|
|
22
20
|
description = "列出已安装的组件"
|
|
23
21
|
|
|
24
22
|
def __init__(self):
|
|
25
|
-
"""初始化命令"""
|
|
26
23
|
self.package_manager = PackageManager()
|
|
27
24
|
|
|
28
25
|
def add_arguments(self, parser: ArgumentParser):
|
|
29
|
-
"""添加命令参数"""
|
|
30
26
|
parser.add_argument(
|
|
31
27
|
'--type', '-t',
|
|
32
28
|
choices=['modules', 'adapters', 'cli', 'all'],
|
|
@@ -40,7 +36,6 @@ class ListCommand(Command):
|
|
|
40
36
|
)
|
|
41
37
|
|
|
42
38
|
def execute(self, args):
|
|
43
|
-
"""执行命令"""
|
|
44
39
|
pkg_type = args.type
|
|
45
40
|
outdated_only = args.outdated
|
|
46
41
|
|
|
@@ -14,28 +14,16 @@ import asyncio
|
|
|
14
14
|
from argparse import ArgumentParser
|
|
15
15
|
from rich.table import Table
|
|
16
16
|
from rich.box import SIMPLE
|
|
17
|
-
from
|
|
18
|
-
from
|
|
17
|
+
from ..utils import PackageManager
|
|
18
|
+
from ..console import console
|
|
19
19
|
from ..base import Command
|
|
20
20
|
|
|
21
21
|
class ListCommand(Command):
|
|
22
|
-
"""
|
|
23
|
-
列表命令
|
|
24
|
-
"""
|
|
25
22
|
def __init__(self: None) -> ...:
|
|
26
|
-
"""
|
|
27
|
-
初始化命令
|
|
28
|
-
"""
|
|
29
23
|
...
|
|
30
24
|
def add_arguments(self: object, parser: ArgumentParser) -> ...:
|
|
31
|
-
"""
|
|
32
|
-
添加命令参数
|
|
33
|
-
"""
|
|
34
25
|
...
|
|
35
26
|
def execute(self: object, args: ...) -> ...:
|
|
36
|
-
"""
|
|
37
|
-
执行命令
|
|
38
|
-
"""
|
|
39
27
|
...
|
|
40
28
|
def _print_installed_packages(self: object, pkg_type: str, outdated_only: bool = ...) -> ...:
|
|
41
29
|
"""
|
|
@@ -10,23 +10,19 @@ from argparse import ArgumentParser
|
|
|
10
10
|
from rich.table import Table
|
|
11
11
|
from rich.box import SIMPLE
|
|
12
12
|
|
|
13
|
-
from
|
|
14
|
-
from
|
|
13
|
+
from ..utils import PackageManager
|
|
14
|
+
from ..console import console
|
|
15
15
|
from ..base import Command
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class ListRemoteCommand(Command):
|
|
19
|
-
"""远程列表命令"""
|
|
20
|
-
|
|
21
19
|
name = "list-remote"
|
|
22
20
|
description = "列出远程可用的组件"
|
|
23
21
|
|
|
24
22
|
def __init__(self):
|
|
25
|
-
"""初始化命令"""
|
|
26
23
|
self.package_manager = PackageManager()
|
|
27
24
|
|
|
28
25
|
def add_arguments(self, parser: ArgumentParser):
|
|
29
|
-
"""添加命令参数"""
|
|
30
26
|
parser.add_argument(
|
|
31
27
|
'--type', '-t',
|
|
32
28
|
choices=['modules', 'adapters', 'cli', 'all'],
|
|
@@ -40,7 +36,6 @@ class ListRemoteCommand(Command):
|
|
|
40
36
|
)
|
|
41
37
|
|
|
42
38
|
def execute(self, args):
|
|
43
|
-
"""执行命令"""
|
|
44
39
|
pkg_type = args.type
|
|
45
40
|
force_refresh = args.refresh
|
|
46
41
|
|
|
@@ -14,28 +14,16 @@ import asyncio
|
|
|
14
14
|
from argparse import ArgumentParser
|
|
15
15
|
from rich.table import Table
|
|
16
16
|
from rich.box import SIMPLE
|
|
17
|
-
from
|
|
18
|
-
from
|
|
17
|
+
from ..utils import PackageManager
|
|
18
|
+
from ..console import console
|
|
19
19
|
from ..base import Command
|
|
20
20
|
|
|
21
21
|
class ListRemoteCommand(Command):
|
|
22
|
-
"""
|
|
23
|
-
远程列表命令
|
|
24
|
-
"""
|
|
25
22
|
def __init__(self: None) -> ...:
|
|
26
|
-
"""
|
|
27
|
-
初始化命令
|
|
28
|
-
"""
|
|
29
23
|
...
|
|
30
24
|
def add_arguments(self: object, parser: ArgumentParser) -> ...:
|
|
31
|
-
"""
|
|
32
|
-
添加命令参数
|
|
33
|
-
"""
|
|
34
25
|
...
|
|
35
26
|
def execute(self: object, args: ...) -> ...:
|
|
36
|
-
"""
|
|
37
|
-
执行命令
|
|
38
|
-
"""
|
|
39
27
|
...
|
|
40
28
|
def _print_remote_packages(self: object, pkg_type: str, force_refresh: bool = ...) -> ...:
|
|
41
29
|
"""
|
|
@@ -10,19 +10,16 @@ from argparse import ArgumentParser
|
|
|
10
10
|
from watchdog.observers import Observer
|
|
11
11
|
from rich.panel import Panel
|
|
12
12
|
|
|
13
|
-
from
|
|
14
|
-
from
|
|
13
|
+
from ..console import console
|
|
14
|
+
from ..utils import ReloadHandler
|
|
15
15
|
from ..base import Command
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class RunCommand(Command):
|
|
19
|
-
"""运行命令"""
|
|
20
|
-
|
|
21
19
|
name = "run"
|
|
22
20
|
description = "运行主程序"
|
|
23
21
|
|
|
24
22
|
def add_arguments(self, parser: ArgumentParser):
|
|
25
|
-
"""添加命令参数"""
|
|
26
23
|
parser.add_argument(
|
|
27
24
|
'script',
|
|
28
25
|
nargs='?',
|
|
@@ -40,12 +37,11 @@ class RunCommand(Command):
|
|
|
40
37
|
)
|
|
41
38
|
|
|
42
39
|
def execute(self, args):
|
|
43
|
-
"""执行命令"""
|
|
44
40
|
script = args.script or "main.py"
|
|
45
41
|
|
|
46
42
|
# 检查脚本是否存在
|
|
47
43
|
if not os.path.exists(script):
|
|
48
|
-
from
|
|
44
|
+
from ... import _prepare_environment
|
|
49
45
|
import asyncio
|
|
50
46
|
asyncio.run(_prepare_environment())
|
|
51
47
|
|
|
@@ -15,23 +15,14 @@ import time
|
|
|
15
15
|
from argparse import ArgumentParser
|
|
16
16
|
from watchdog.observers import Observer
|
|
17
17
|
from rich.panel import Panel
|
|
18
|
-
from
|
|
19
|
-
from
|
|
18
|
+
from ..console import console
|
|
19
|
+
from ..utils import ReloadHandler
|
|
20
20
|
from ..base import Command
|
|
21
21
|
|
|
22
22
|
class RunCommand(Command):
|
|
23
|
-
"""
|
|
24
|
-
运行命令
|
|
25
|
-
"""
|
|
26
23
|
def add_arguments(self: object, parser: ArgumentParser) -> ...:
|
|
27
|
-
"""
|
|
28
|
-
添加命令参数
|
|
29
|
-
"""
|
|
30
24
|
...
|
|
31
25
|
def execute(self: object, args: ...) -> ...:
|
|
32
|
-
"""
|
|
33
|
-
执行命令
|
|
34
|
-
"""
|
|
35
26
|
...
|
|
36
27
|
def _setup_watchdog(self: object, script_path: str, reload_mode: bool) -> ...:
|
|
37
28
|
"""
|
|
@@ -10,23 +10,19 @@ from argparse import ArgumentParser
|
|
|
10
10
|
from rich.prompt import Confirm, Prompt
|
|
11
11
|
from rich.panel import Panel
|
|
12
12
|
|
|
13
|
-
from
|
|
14
|
-
from
|
|
13
|
+
from ..utils import PackageManager
|
|
14
|
+
from ..console import console
|
|
15
15
|
from ..base import Command
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class SelfUpdateCommand(Command):
|
|
19
|
-
"""自更新命令"""
|
|
20
|
-
|
|
21
19
|
name = "self-update"
|
|
22
20
|
description = "更新 ErisPulse SDK 本身"
|
|
23
21
|
|
|
24
22
|
def __init__(self):
|
|
25
|
-
"""初始化命令"""
|
|
26
23
|
self.package_manager = PackageManager()
|
|
27
24
|
|
|
28
25
|
def add_arguments(self, parser: ArgumentParser):
|
|
29
|
-
"""添加命令参数"""
|
|
30
26
|
parser.add_argument(
|
|
31
27
|
'version',
|
|
32
28
|
nargs='?',
|
|
@@ -44,7 +40,6 @@ class SelfUpdateCommand(Command):
|
|
|
44
40
|
)
|
|
45
41
|
|
|
46
42
|
def execute(self, args):
|
|
47
|
-
"""执行命令"""
|
|
48
43
|
current_version = self.package_manager.get_installed_version()
|
|
49
44
|
console.print(Panel(
|
|
50
45
|
f"[title]ErisPulse SDK 自更新[/]\n"
|
|
@@ -15,28 +15,16 @@ import asyncio
|
|
|
15
15
|
from argparse import ArgumentParser
|
|
16
16
|
from rich.prompt import Confirm, Prompt
|
|
17
17
|
from rich.panel import Panel
|
|
18
|
-
from
|
|
19
|
-
from
|
|
18
|
+
from ..utils import PackageManager
|
|
19
|
+
from ..console import console
|
|
20
20
|
from ..base import Command
|
|
21
21
|
|
|
22
22
|
class SelfUpdateCommand(Command):
|
|
23
|
-
"""
|
|
24
|
-
自更新命令
|
|
25
|
-
"""
|
|
26
23
|
def __init__(self: None) -> ...:
|
|
27
|
-
"""
|
|
28
|
-
初始化命令
|
|
29
|
-
"""
|
|
30
24
|
...
|
|
31
25
|
def add_arguments(self: object, parser: ArgumentParser) -> ...:
|
|
32
|
-
"""
|
|
33
|
-
添加命令参数
|
|
34
|
-
"""
|
|
35
26
|
...
|
|
36
27
|
def execute(self: object, args: ...) -> ...:
|
|
37
|
-
"""
|
|
38
|
-
执行命令
|
|
39
|
-
"""
|
|
40
28
|
...
|
|
41
29
|
def _select_target_version(self: object, versions: ..., specified_version: str = ..., include_pre: bool = ...) -> str:
|
|
42
30
|
"""
|
|
@@ -7,23 +7,19 @@ Uninstall 命令实现
|
|
|
7
7
|
import sys
|
|
8
8
|
from argparse import ArgumentParser
|
|
9
9
|
|
|
10
|
-
from
|
|
11
|
-
from ...console import console
|
|
10
|
+
from ..utils import PackageManager
|
|
12
11
|
from ..base import Command
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
class UninstallCommand(Command):
|
|
16
|
-
"""卸载命令"""
|
|
17
15
|
|
|
18
16
|
name = "uninstall"
|
|
19
17
|
description = "卸载模块/适配器包"
|
|
20
18
|
|
|
21
19
|
def __init__(self):
|
|
22
|
-
"""初始化命令"""
|
|
23
20
|
self.package_manager = PackageManager()
|
|
24
21
|
|
|
25
22
|
def add_arguments(self, parser: ArgumentParser):
|
|
26
|
-
"""添加命令参数"""
|
|
27
23
|
parser.add_argument(
|
|
28
24
|
'package',
|
|
29
25
|
nargs='+',
|
|
@@ -31,7 +27,6 @@ class UninstallCommand(Command):
|
|
|
31
27
|
)
|
|
32
28
|
|
|
33
29
|
def execute(self, args):
|
|
34
|
-
"""执行命令"""
|
|
35
30
|
success = self.package_manager.uninstall_package(args.package)
|
|
36
31
|
if not success:
|
|
37
32
|
sys.exit(1)
|
|
@@ -12,26 +12,13 @@ Uninstall 命令实现
|
|
|
12
12
|
|
|
13
13
|
import sys
|
|
14
14
|
from argparse import ArgumentParser
|
|
15
|
-
from
|
|
16
|
-
from ...console import console
|
|
15
|
+
from ..utils import PackageManager
|
|
17
16
|
from ..base import Command
|
|
18
17
|
|
|
19
18
|
class UninstallCommand(Command):
|
|
20
|
-
"""
|
|
21
|
-
卸载命令
|
|
22
|
-
"""
|
|
23
19
|
def __init__(self: None) -> ...:
|
|
24
|
-
"""
|
|
25
|
-
初始化命令
|
|
26
|
-
"""
|
|
27
20
|
...
|
|
28
21
|
def add_arguments(self: object, parser: ArgumentParser) -> ...:
|
|
29
|
-
"""
|
|
30
|
-
添加命令参数
|
|
31
|
-
"""
|
|
32
22
|
...
|
|
33
23
|
def execute(self: object, args: ...) -> ...:
|
|
34
|
-
"""
|
|
35
|
-
执行命令
|
|
36
|
-
"""
|
|
37
24
|
...
|
|
@@ -8,23 +8,18 @@ import sys
|
|
|
8
8
|
from argparse import ArgumentParser
|
|
9
9
|
from rich.prompt import Confirm
|
|
10
10
|
|
|
11
|
-
from
|
|
12
|
-
from ...console import console
|
|
11
|
+
from ..utils import PackageManager
|
|
13
12
|
from ..base import Command
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
class UpgradeCommand(Command):
|
|
17
|
-
"""升级命令"""
|
|
18
|
-
|
|
19
16
|
name = "upgrade"
|
|
20
17
|
description = "升级组件(不指定包名则升级所有)"
|
|
21
18
|
|
|
22
19
|
def __init__(self):
|
|
23
|
-
"""初始化命令"""
|
|
24
20
|
self.package_manager = PackageManager()
|
|
25
21
|
|
|
26
22
|
def add_arguments(self, parser: ArgumentParser):
|
|
27
|
-
"""添加命令参数"""
|
|
28
23
|
parser.add_argument(
|
|
29
24
|
'package',
|
|
30
25
|
nargs='*',
|
|
@@ -42,7 +37,6 @@ class UpgradeCommand(Command):
|
|
|
42
37
|
)
|
|
43
38
|
|
|
44
39
|
def execute(self, args):
|
|
45
|
-
"""执行命令"""
|
|
46
40
|
if args.package:
|
|
47
41
|
# 升级指定包
|
|
48
42
|
success = self.package_manager.upgrade_package(
|
|
@@ -13,26 +13,13 @@ Upgrade 命令实现
|
|
|
13
13
|
import sys
|
|
14
14
|
from argparse import ArgumentParser
|
|
15
15
|
from rich.prompt import Confirm
|
|
16
|
-
from
|
|
17
|
-
from ...console import console
|
|
16
|
+
from ..utils import PackageManager
|
|
18
17
|
from ..base import Command
|
|
19
18
|
|
|
20
19
|
class UpgradeCommand(Command):
|
|
21
|
-
"""
|
|
22
|
-
升级命令
|
|
23
|
-
"""
|
|
24
20
|
def __init__(self: None) -> ...:
|
|
25
|
-
"""
|
|
26
|
-
初始化命令
|
|
27
|
-
"""
|
|
28
21
|
...
|
|
29
22
|
def add_arguments(self: object, parser: ArgumentParser) -> ...:
|
|
30
|
-
"""
|
|
31
|
-
添加命令参数
|
|
32
|
-
"""
|
|
33
23
|
...
|
|
34
24
|
def execute(self: object, args: ...) -> ...:
|
|
35
|
-
"""
|
|
36
|
-
执行命令
|
|
37
|
-
"""
|
|
38
25
|
...
|
|
@@ -6,12 +6,8 @@ ErisPulse SDK 工具模块
|
|
|
6
6
|
|
|
7
7
|
from .package_manager import PackageManager
|
|
8
8
|
from .reload_handler import ReloadHandler
|
|
9
|
-
from .cli import CLI
|
|
10
|
-
from .console import console
|
|
11
9
|
|
|
12
10
|
__all__ = [
|
|
13
11
|
"PackageManager",
|
|
14
|
-
"ReloadHandler"
|
|
15
|
-
"CLI",
|
|
16
|
-
"console",
|
|
12
|
+
"ReloadHandler"
|
|
17
13
|
]
|