muscles-cli 1.0.0__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.
- muscles/cli/Makefile +26 -0
- muscles/cli/__about__.py +6 -0
- muscles/cli/__init__.py +66 -0
- muscles/cli/__main__.py +5 -0
- muscles/cli/cli/__init__.py +6 -0
- muscles/cli/cli/cli.py +44 -0
- muscles/cli/cli/colory.py +15 -0
- muscles/cli/cli/command.py +778 -0
- muscles/cli/cli/constants.py +3 -0
- muscles/cli/cli/error_handler.py +6 -0
- muscles/cli/cli/func.py +221 -0
- muscles/cli/cli/instance.py +47 -0
- muscles/cli/cli/strategy.py +111 -0
- muscles/cli/providers.py +198 -0
- muscles/cli/streaming.py +50 -0
- muscles/cli/tooling.py +927 -0
- muscles_cli-1.0.0.dist-info/METADATA +165 -0
- muscles_cli-1.0.0.dist-info/RECORD +20 -0
- muscles_cli-1.0.0.dist-info/WHEEL +4 -0
- muscles_cli-1.0.0.dist-info/entry_points.txt +3 -0
muscles/cli/Makefile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Makefile
|
|
2
|
+
|
|
3
|
+
start:
|
|
4
|
+
docker-compose up -d
|
|
5
|
+
docker exec -it butkoinfo_core_1 bash
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
stop:
|
|
9
|
+
docker-compose up -d
|
|
10
|
+
docker exec -it butkoinfo-core-1 bash
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
console:
|
|
14
|
+
docker exec -it butkoinfo_core_1 bash
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
logs:
|
|
18
|
+
docker-compose logs
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
develop:
|
|
22
|
+
#docker exec -it butkoinfo_core_1 pipenv install
|
|
23
|
+
pipenv run python setup.py develop
|
|
24
|
+
pipenv install
|
|
25
|
+
|
|
26
|
+
|
muscles/cli/__about__.py
ADDED
muscles/cli/__init__.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from .cli import Colors
|
|
2
|
+
from .cli import Command
|
|
3
|
+
from .cli import Argument
|
|
4
|
+
from .cli import Group
|
|
5
|
+
from .cli import Console
|
|
6
|
+
from .cli import cli
|
|
7
|
+
from .cli import argsparse
|
|
8
|
+
from .cli import CliStrategy
|
|
9
|
+
from .cli import ConsoleErrorHandler
|
|
10
|
+
from .streaming import CliStreamRenderResult
|
|
11
|
+
from .streaming import render_stream_result
|
|
12
|
+
from .tooling import build_capabilities_payload
|
|
13
|
+
from .tooling import build_inspection_payload
|
|
14
|
+
from .tooling import detect_project_root
|
|
15
|
+
from .tooling import generate_artifact
|
|
16
|
+
from .tooling import load_app_from_entrypoint
|
|
17
|
+
from .tooling import main
|
|
18
|
+
from .tooling import run_doctor
|
|
19
|
+
from .tooling import run_project_tests
|
|
20
|
+
from .tooling import scaffold_project
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
_TOOLING_EXPORTS = {
|
|
24
|
+
"scaffold_project",
|
|
25
|
+
"main",
|
|
26
|
+
"build_capabilities_payload",
|
|
27
|
+
"load_app_from_entrypoint",
|
|
28
|
+
"build_inspection_payload",
|
|
29
|
+
"generate_artifact",
|
|
30
|
+
"detect_project_root",
|
|
31
|
+
"run_doctor",
|
|
32
|
+
"run_project_tests",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def __getattr__(name):
|
|
37
|
+
if name in _TOOLING_EXPORTS:
|
|
38
|
+
import importlib
|
|
39
|
+
|
|
40
|
+
tooling = importlib.import_module(".tooling", __name__)
|
|
41
|
+
return getattr(tooling, name)
|
|
42
|
+
raise AttributeError(name)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
__all__ = (
|
|
46
|
+
"Colors",
|
|
47
|
+
"Command",
|
|
48
|
+
"Argument",
|
|
49
|
+
"Group",
|
|
50
|
+
"Console",
|
|
51
|
+
"cli",
|
|
52
|
+
"argsparse",
|
|
53
|
+
"CliStrategy",
|
|
54
|
+
"ConsoleErrorHandler",
|
|
55
|
+
"scaffold_project",
|
|
56
|
+
"build_capabilities_payload",
|
|
57
|
+
"load_app_from_entrypoint",
|
|
58
|
+
"build_inspection_payload",
|
|
59
|
+
"generate_artifact",
|
|
60
|
+
"detect_project_root",
|
|
61
|
+
"run_doctor",
|
|
62
|
+
"run_project_tests",
|
|
63
|
+
"CliStreamRenderResult",
|
|
64
|
+
"render_stream_result",
|
|
65
|
+
"main",
|
|
66
|
+
)
|
muscles/cli/__main__.py
ADDED
muscles/cli/cli/cli.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from abc import ABC, abstractmethod
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CliCommand(ABC):
|
|
7
|
+
"""
|
|
8
|
+
Интерфейс консольной команды или группы
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
_key = None
|
|
13
|
+
_parent = None
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def parent(self) -> CliCommand | None:
|
|
17
|
+
return self._parent
|
|
18
|
+
|
|
19
|
+
@parent.setter
|
|
20
|
+
def parent(self, parent: CliCommand | None):
|
|
21
|
+
self._parent = parent
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def key(self) -> list[str]:
|
|
25
|
+
return self._key or []
|
|
26
|
+
|
|
27
|
+
@key.setter
|
|
28
|
+
def key(self, key) -> None:
|
|
29
|
+
self._key = key
|
|
30
|
+
|
|
31
|
+
def add(self, command) -> None:
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
def remove(self, command) -> None:
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
@abstractmethod
|
|
38
|
+
def execute(self, *args, **kwargs) -> Any:
|
|
39
|
+
"""
|
|
40
|
+
Базовый Компонент может сам реализовать некоторое поведение по умолчанию
|
|
41
|
+
или поручить это конкретным классам, объявив метод, содержащий поведение
|
|
42
|
+
абстрактным.
|
|
43
|
+
"""
|
|
44
|
+
pass
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Colors:
|
|
5
|
+
HEADER = '\033[95m'
|
|
6
|
+
OKBLUE = '\033[94m'
|
|
7
|
+
OKCYAN = '\033[96m'
|
|
8
|
+
OKGREEN = '\033[92m'
|
|
9
|
+
WARNING = '\033[93m'
|
|
10
|
+
FAIL = '\033[91m'
|
|
11
|
+
ENDC = '\033[0m'
|
|
12
|
+
BOLD = '\033[1m'
|
|
13
|
+
UNDERLINE = '\033[4m'
|
|
14
|
+
|
|
15
|
+
|