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 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
+
@@ -0,0 +1,6 @@
1
+ # -*- coding: utf-8 -*-
2
+ __name__ = "Muscular CLI Framework"
3
+ __version__ = "1.0.0.dev"
4
+ __description__ = (
5
+ "Muscular CLI Framework"
6
+ )
@@ -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
+ )
@@ -0,0 +1,5 @@
1
+ from .tooling import main
2
+
3
+
4
+ if __name__ == "__main__":
5
+ raise SystemExit(main())
@@ -0,0 +1,6 @@
1
+ from .colory import Colors
2
+ from .command import Command, Argument, Group
3
+ from .instance import Console, cli
4
+ from .func import argsparse
5
+ from .strategy import CliStrategy
6
+ from .error_handler import ConsoleErrorHandler
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
+