zrb 0.15.0__py3-none-any.whl → 0.15.1__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.
- zrb/__main__.py +0 -3
- zrb/action/runner.py +6 -2
- zrb/advertisement.py +4 -0
- zrb/builtin/devtool/install/_input.py +2 -4
- zrb/builtin/project/create/template/project.sh +1 -0
- zrb/config/config.py +21 -14
- zrb/helper/accessories/color.py +5 -2
- zrb/helper/accessories/icon.py +4 -0
- zrb/helper/accessories/name.py +4 -0
- zrb/helper/accessories/untyped_color.py +10 -0
- zrb/helper/advertisement.py +3 -0
- zrb/helper/callable.py +5 -0
- zrb/helper/cli.py +2 -0
- zrb/helper/codemod/add_argument_to_function.py +6 -0
- zrb/helper/codemod/add_argument_to_function_call.py +6 -0
- zrb/helper/codemod/add_assert_resource.py +4 -0
- zrb/helper/codemod/add_function_call.py +4 -0
- zrb/helper/codemod/add_import_module.py +4 -0
- zrb/helper/codemod/add_key_value_to_dict.py +6 -0
- zrb/helper/codemod/add_property_to_class.py +6 -0
- zrb/helper/codemod/add_upstream_to_task.py +4 -0
- zrb/helper/codemod/append_code_to_function.py +6 -0
- zrb/helper/codemod/format_code.py +4 -0
- zrb/helper/default_env.py +2 -0
- zrb/helper/docker_compose/fetch_external_env.py +6 -0
- zrb/helper/docker_compose/file.py +4 -0
- zrb/helper/docstring.py +5 -0
- zrb/helper/env_map/fetch.py +4 -0
- zrb/helper/file/copy_tree.py +3 -0
- zrb/helper/file/match.py +4 -0
- zrb/helper/file/text.py +4 -0
- zrb/helper/git/detect_changes.py +4 -0
- zrb/helper/loader/load_module.py +2 -0
- zrb/helper/log.py +1 -1
- zrb/helper/map/conversion.py +4 -0
- zrb/helper/python_task.py +3 -0
- zrb/helper/render_data.py +4 -0
- zrb/helper/string/conversion.py +13 -36
- zrb/helper/string/jinja.py +4 -0
- zrb/helper/string/modification.py +4 -0
- zrb/helper/string/parse_replacement.py +4 -0
- zrb/helper/string/untyped_conversion.py +49 -0
- zrb/helper/task.py +4 -0
- zrb/helper/typecheck.py +6 -7
- zrb/helper/typing.py +32 -12
- zrb/helper/util.py +4 -0
- zrb/runner.py +3 -0
- zrb/task/any_task.py +4 -0
- zrb/task/any_task_event_handler.py +4 -0
- zrb/task/base_remote_cmd_task.py +4 -0
- zrb/task/checker.py +4 -0
- zrb/task/cmd_task.py +4 -1
- zrb/task/decorator.py +4 -0
- zrb/task/docker_compose_task.py +4 -0
- zrb/task/flow_task.py +4 -0
- zrb/task/http_checker.py +4 -0
- zrb/task/notifier.py +4 -0
- zrb/task/parallel.py +4 -0
- zrb/task/path_checker.py +4 -0
- zrb/task/path_watcher.py +4 -0
- zrb/task/port_checker.py +4 -0
- zrb/task/recurring_task.py +4 -0
- zrb/task/remote_cmd_task.py +4 -0
- zrb/task/resource_maker.py +4 -0
- zrb/task/rsync_task.py +4 -0
- zrb/task/task.py +4 -0
- zrb/task/time_watcher.py +4 -0
- zrb/task/wiki_task.py +4 -0
- zrb/task_env/constant.py +5 -0
- zrb/task_env/env.py +4 -0
- zrb/task_env/env_file.py +4 -0
- zrb/task_group/group.py +4 -0
- zrb/task_input/any_input.py +4 -0
- zrb/task_input/base_input.py +4 -0
- zrb/task_input/bool_input.py +4 -0
- zrb/task_input/choice_input.py +4 -0
- zrb/task_input/constant.py +5 -0
- zrb/task_input/float_input.py +4 -0
- zrb/task_input/int_input.py +4 -0
- zrb/task_input/password_input.py +4 -0
- zrb/task_input/str_input.py +4 -0
- zrb/task_input/task_input.py +4 -0
- {zrb-0.15.0.dist-info → zrb-0.15.1.dist-info}/METADATA +1 -1
- {zrb-0.15.0.dist-info → zrb-0.15.1.dist-info}/RECORD +87 -85
- {zrb-0.15.0.dist-info → zrb-0.15.1.dist-info}/LICENSE +0 -0
- {zrb-0.15.0.dist-info → zrb-0.15.1.dist-info}/WHEEL +0 -0
- {zrb-0.15.0.dist-info → zrb-0.15.1.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,10 @@
|
|
1
|
+
from zrb.helper.accessories.color import colored
|
2
|
+
from zrb.helper.log import logger
|
1
3
|
from zrb.helper.typecheck import typechecked
|
2
4
|
from zrb.helper.typing import Mapping
|
3
5
|
|
6
|
+
logger.debug(colored("Loading zrb.helper.string.parse_replacment", attrs=["dark"]))
|
7
|
+
|
4
8
|
|
5
9
|
@typechecked
|
6
10
|
def parse_replacement(text: str, replacement: Mapping[str, str]):
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import keyword
|
2
|
+
import logging
|
3
|
+
import re
|
4
|
+
|
5
|
+
from zrb.helper.string.constant import FALSE_STRS, TRUE_STRS
|
6
|
+
|
7
|
+
NON_WORD = re.compile(r"[\W]+")
|
8
|
+
LEADING_NUM = re.compile(r"^\d+")
|
9
|
+
LOGGING_LEVEL_MAP = {
|
10
|
+
"critical": logging.CRITICAL,
|
11
|
+
"fatal": logging.FATAL,
|
12
|
+
"error": logging.ERROR,
|
13
|
+
"warning": logging.WARNING,
|
14
|
+
"warn": logging.WARN,
|
15
|
+
"info": logging.INFO,
|
16
|
+
"debug": logging.DEBUG,
|
17
|
+
"notset": logging.NOTSET,
|
18
|
+
}
|
19
|
+
|
20
|
+
|
21
|
+
def untyped_to_cli_name(name: str) -> str:
|
22
|
+
return NON_WORD.sub("-", name).strip("-").lower()
|
23
|
+
|
24
|
+
|
25
|
+
def untyped_to_variable_name(string: str) -> str:
|
26
|
+
# Replace any non-word characters with underscore
|
27
|
+
string = NON_WORD.sub("_", string).strip()
|
28
|
+
# Remove leading digits
|
29
|
+
string = LEADING_NUM.sub("", string)
|
30
|
+
# Convert to lowercase
|
31
|
+
string = string.lower()
|
32
|
+
if keyword.iskeyword(string):
|
33
|
+
return string + "_"
|
34
|
+
return string
|
35
|
+
|
36
|
+
|
37
|
+
def untyped_to_boolean(string: str) -> bool:
|
38
|
+
if string.lower() in TRUE_STRS:
|
39
|
+
return True
|
40
|
+
if string.lower() in FALSE_STRS:
|
41
|
+
return False
|
42
|
+
raise Exception(f'Cannot infer boolean value from "{string}"')
|
43
|
+
|
44
|
+
|
45
|
+
def untyped_to_logging_level(logging_level_str: str) -> int:
|
46
|
+
lower_logging_level_str = logging_level_str.lower()
|
47
|
+
if lower_logging_level_str in LOGGING_LEVEL_MAP:
|
48
|
+
return LOGGING_LEVEL_MAP[lower_logging_level_str]
|
49
|
+
return logging.WARNING
|
zrb/helper/task.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
from zrb.helper.accessories.color import colored
|
2
|
+
from zrb.helper.log import logger
|
1
3
|
from zrb.helper.typecheck import typechecked
|
2
4
|
from zrb.task.task import Task
|
3
5
|
|
6
|
+
logger.debug(colored("Loading zrb.helper.task", attrs=["dark"]))
|
7
|
+
|
4
8
|
|
5
9
|
@typechecked
|
6
10
|
def show_lines(task: Task, *lines: str):
|
zrb/helper/typecheck.py
CHANGED
@@ -1,17 +1,16 @@
|
|
1
|
-
import os
|
2
1
|
from typing import TypeVar
|
3
2
|
|
4
|
-
from
|
5
|
-
|
6
|
-
from zrb.helper.
|
7
|
-
|
8
|
-
enable_type_checking_str = os.getenv("ZRB_ENABLE_TYPE_CHECKING", "1").lower()
|
9
|
-
enable_type_checking = enable_type_checking_str not in FALSE_STRS
|
3
|
+
from zrb.config.config import enable_type_checking
|
4
|
+
from zrb.helper.accessories.untyped_color import untyped_colored as colored
|
5
|
+
from zrb.helper.log import logger
|
10
6
|
|
7
|
+
logger.debug(colored("Loading zrb.helper.typecheck", attrs=["dark"]))
|
11
8
|
T = TypeVar("T")
|
12
9
|
|
13
10
|
|
14
11
|
def typechecked(anything: T) -> T:
|
15
12
|
if enable_type_checking:
|
13
|
+
from beartype import beartype
|
14
|
+
|
16
15
|
return beartype(anything)
|
17
16
|
return anything
|
zrb/helper/typing.py
CHANGED
@@ -1,15 +1,35 @@
|
|
1
|
-
from
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
from zrb.config.config import enable_type_checking
|
2
|
+
from zrb.helper.accessories.untyped_color import untyped_colored as colored
|
3
|
+
from zrb.helper.log import logger
|
4
|
+
|
5
|
+
logger.debug(colored("Loading zrb.helper.typing", attrs=["dark"]))
|
6
|
+
|
7
|
+
if enable_type_checking:
|
8
|
+
from beartype.typing import (
|
9
|
+
Any,
|
10
|
+
Callable,
|
11
|
+
Iterable,
|
12
|
+
List,
|
13
|
+
Mapping,
|
14
|
+
Optional,
|
15
|
+
Tuple,
|
16
|
+
Type,
|
17
|
+
TypeVar,
|
18
|
+
Union,
|
19
|
+
)
|
20
|
+
else:
|
21
|
+
from typing import (
|
22
|
+
Any,
|
23
|
+
Callable,
|
24
|
+
Iterable,
|
25
|
+
List,
|
26
|
+
Mapping,
|
27
|
+
Optional,
|
28
|
+
Tuple,
|
29
|
+
Type,
|
30
|
+
TypeVar,
|
31
|
+
Union,
|
32
|
+
)
|
13
33
|
|
14
34
|
JinjaTemplate = str
|
15
35
|
|
zrb/helper/util.py
CHANGED
@@ -2,10 +2,14 @@ import re
|
|
2
2
|
|
3
3
|
import jinja2
|
4
4
|
|
5
|
+
from zrb.helper.accessories.color import colored
|
6
|
+
from zrb.helper.log import logger
|
5
7
|
from zrb.helper.string.conversion import to_boolean as conversion_to_boolean
|
6
8
|
from zrb.helper.typecheck import typechecked
|
7
9
|
from zrb.helper.typing import Any, Optional
|
8
10
|
|
11
|
+
logger.debug(colored("Loading zrb.helper.util", attrs=["dark"]))
|
12
|
+
|
9
13
|
NON_ALPHA_NUM = re.compile(r"[^a-zA-Z0-9]+")
|
10
14
|
|
11
15
|
|
zrb/runner.py
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
from zrb.action.runner import Runner
|
2
2
|
from zrb.config.config import env_prefix
|
3
|
+
from zrb.helper.accessories.color import colored
|
4
|
+
from zrb.helper.log import logger
|
3
5
|
|
6
|
+
logger.debug(colored("Loading zrb.runner", attrs=["dark"]))
|
4
7
|
runner = Runner(env_prefix=env_prefix)
|
zrb/task/any_task.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
2
|
|
3
|
+
from zrb.helper.accessories.color import colored
|
4
|
+
from zrb.helper.log import logger
|
3
5
|
from zrb.helper.typing import (
|
4
6
|
Any,
|
5
7
|
Callable,
|
@@ -15,6 +17,8 @@ from zrb.task_env.env import Env
|
|
15
17
|
from zrb.task_env.env_file import EnvFile
|
16
18
|
from zrb.task_input.any_input import AnyInput
|
17
19
|
|
20
|
+
logger.debug(colored("Loading zrb.task.any_task", attrs=["dark"]))
|
21
|
+
|
18
22
|
# flake8: noqa E501
|
19
23
|
TAnyTask = TypeVar("TAnyTask", bound="AnyTask")
|
20
24
|
|
@@ -1,6 +1,10 @@
|
|
1
|
+
from zrb.helper.accessories.color import colored
|
2
|
+
from zrb.helper.log import logger
|
1
3
|
from zrb.helper.typing import Any, Callable
|
2
4
|
from zrb.task.any_task import AnyTask
|
3
5
|
|
6
|
+
logger.debug(colored("Loading zrb.task.any_task_event_handler", attrs=["dark"]))
|
7
|
+
|
4
8
|
_TaskEventHandler = Callable[[AnyTask], Any]
|
5
9
|
OnTriggered = _TaskEventHandler
|
6
10
|
OnWaiting = _TaskEventHandler
|
zrb/task/base_remote_cmd_task.py
CHANGED
@@ -2,6 +2,8 @@ import copy
|
|
2
2
|
import os
|
3
3
|
import pathlib
|
4
4
|
|
5
|
+
from zrb.helper.accessories.color import colored
|
6
|
+
from zrb.helper.log import logger
|
5
7
|
from zrb.helper.typecheck import typechecked
|
6
8
|
from zrb.helper.typing import (
|
7
9
|
Any,
|
@@ -31,6 +33,8 @@ from zrb.task_env.env_file import EnvFile
|
|
31
33
|
from zrb.task_group.group import Group
|
32
34
|
from zrb.task_input.any_input import AnyInput
|
33
35
|
|
36
|
+
logger.debug(colored("Loading zrb.task.base_remote_cmd_task", attrs=["dark"]))
|
37
|
+
|
34
38
|
TSingleBaseRemoteCmdTask = TypeVar(
|
35
39
|
"TSingleBaseRemoteCmdTask", bound="SingleBaseRemoteCmdTask"
|
36
40
|
)
|
zrb/task/checker.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
import asyncio
|
2
2
|
|
3
|
+
from zrb.helper.accessories.color import colored
|
4
|
+
from zrb.helper.log import logger
|
3
5
|
from zrb.helper.typecheck import typechecked
|
4
6
|
from zrb.helper.typing import Any, Callable, Iterable, Optional, Union
|
5
7
|
from zrb.task.any_task import AnyTask
|
@@ -18,6 +20,8 @@ from zrb.task_env.env_file import EnvFile
|
|
18
20
|
from zrb.task_group.group import Group
|
19
21
|
from zrb.task_input.any_input import AnyInput
|
20
22
|
|
23
|
+
logger.debug(colored("Loading zrb.task.checker", attrs=["dark"]))
|
24
|
+
|
21
25
|
|
22
26
|
@typechecked
|
23
27
|
class Checker(BaseTask):
|
zrb/task/cmd_task.py
CHANGED
@@ -8,7 +8,8 @@ import sys
|
|
8
8
|
import time
|
9
9
|
|
10
10
|
from zrb.config.config import default_shell
|
11
|
-
from zrb.helper.
|
11
|
+
from zrb.helper.accessories.color import colored
|
12
|
+
from zrb.helper.log import logger
|
12
13
|
from zrb.helper.typecheck import typechecked
|
13
14
|
from zrb.helper.typing import (
|
14
15
|
Any,
|
@@ -36,6 +37,8 @@ from zrb.task_env.env_file import EnvFile
|
|
36
37
|
from zrb.task_group.group import Group
|
37
38
|
from zrb.task_input.any_input import AnyInput
|
38
39
|
|
40
|
+
logger.debug(colored("Loading zrb.task.cmd_task", attrs=["dark"]))
|
41
|
+
|
39
42
|
_has_stty = True
|
40
43
|
try:
|
41
44
|
_original_stty = subprocess.getoutput("stty -g").rstrip()
|
zrb/task/decorator.py
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
from zrb.action.runner import Runner
|
2
|
+
from zrb.helper.accessories.color import colored
|
3
|
+
from zrb.helper.log import logger
|
2
4
|
from zrb.helper.typecheck import typechecked
|
3
5
|
from zrb.helper.typing import Any, Callable, Iterable, Optional, Union
|
4
6
|
from zrb.task.any_task import AnyTask
|
@@ -17,6 +19,8 @@ from zrb.task_env.env_file import EnvFile
|
|
17
19
|
from zrb.task_group.group import Group
|
18
20
|
from zrb.task_input.any_input import AnyInput
|
19
21
|
|
22
|
+
logger.debug(colored("Loading zrb.task.decorator", attrs=["dark"]))
|
23
|
+
|
20
24
|
# flake8: noqa E501
|
21
25
|
|
22
26
|
|
zrb/task/docker_compose_task.py
CHANGED
@@ -2,9 +2,11 @@ import os
|
|
2
2
|
import pathlib
|
3
3
|
|
4
4
|
from zrb.config.config import container_backend
|
5
|
+
from zrb.helper.accessories.color import colored
|
5
6
|
from zrb.helper.accessories.name import get_random_name
|
6
7
|
from zrb.helper.docker_compose.fetch_external_env import fetch_compose_file_env_map
|
7
8
|
from zrb.helper.docker_compose.file import read_compose_file, write_compose_file
|
9
|
+
from zrb.helper.log import logger
|
8
10
|
from zrb.helper.string.conversion import to_cli_name
|
9
11
|
from zrb.helper.string.modification import double_quote
|
10
12
|
from zrb.helper.typecheck import typechecked
|
@@ -37,6 +39,8 @@ from zrb.task_env.env_file import EnvFile
|
|
37
39
|
from zrb.task_group.group import Group
|
38
40
|
from zrb.task_input.any_input import AnyInput
|
39
41
|
|
42
|
+
logger.debug(colored("Loading zrb.task.docker_compose_task", attrs=["dark"]))
|
43
|
+
|
40
44
|
|
41
45
|
def _get_ensure_zrb_network_task(backend: str):
|
42
46
|
CURRENT_DIR = os.path.dirname(__file__)
|
zrb/task/flow_task.py
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
from zrb.helper.accessories.color import colored
|
2
|
+
from zrb.helper.log import logger
|
1
3
|
from zrb.helper.typecheck import typechecked
|
2
4
|
from zrb.helper.typing import Callable, Iterable, List, Optional, TypeVar, Union
|
3
5
|
from zrb.task.any_task import AnyTask
|
@@ -16,6 +18,8 @@ from zrb.task_env.env_file import EnvFile
|
|
16
18
|
from zrb.task_group.group import Group
|
17
19
|
from zrb.task_input.any_input import AnyInput
|
18
20
|
|
21
|
+
logger.debug(colored("Loading zrb.task.flow_task", attrs=["dark"]))
|
22
|
+
|
19
23
|
TFlowTask = TypeVar("TFlowTask", bound="FlowTask")
|
20
24
|
|
21
25
|
|
zrb/task/http_checker.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
from http.client import HTTPConnection, HTTPSConnection
|
2
2
|
|
3
|
+
from zrb.helper.accessories.color import colored
|
4
|
+
from zrb.helper.log import logger
|
3
5
|
from zrb.helper.typecheck import typechecked
|
4
6
|
from zrb.helper.typing import (
|
5
7
|
Any,
|
@@ -26,6 +28,8 @@ from zrb.task_env.env_file import EnvFile
|
|
26
28
|
from zrb.task_group.group import Group
|
27
29
|
from zrb.task_input.any_input import AnyInput
|
28
30
|
|
31
|
+
logger.debug(colored("Loading zrb.task.http_checker", attrs=["dark"]))
|
32
|
+
|
29
33
|
THTTPChecker = TypeVar("THTTPChecker", bound="HTTPChecker")
|
30
34
|
|
31
35
|
|
zrb/task/notifier.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
import os
|
2
2
|
import subprocess
|
3
3
|
|
4
|
+
from zrb.helper.accessories.color import colored
|
4
5
|
from zrb.helper.accessories.icon import get_random_icon
|
6
|
+
from zrb.helper.log import logger
|
5
7
|
from zrb.helper.string.modification import double_quote
|
6
8
|
from zrb.helper.typecheck import typechecked
|
7
9
|
from zrb.helper.typing import Any, Callable, Iterable, JinjaTemplate, Optional, Union
|
@@ -21,6 +23,8 @@ from zrb.task_env.env_file import EnvFile
|
|
21
23
|
from zrb.task_group.group import Group
|
22
24
|
from zrb.task_input.any_input import AnyInput
|
23
25
|
|
26
|
+
logger.debug(colored("Loading zrb.task.notifier", attrs=["dark"]))
|
27
|
+
|
24
28
|
_CURRENT_DIR = os.path.dirname(__file__)
|
25
29
|
_NOTIFY_PS1_PATH = os.path.realpath(
|
26
30
|
os.path.abspath(
|
zrb/task/parallel.py
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
2
|
|
3
|
+
from zrb.helper.accessories.color import colored
|
4
|
+
from zrb.helper.log import logger
|
3
5
|
from zrb.helper.typecheck import typechecked
|
4
6
|
from zrb.helper.typing import List, TypeVar, Union
|
5
7
|
from zrb.task.any_task import AnyTask
|
6
8
|
|
9
|
+
logger.debug(colored("Loading zrb.task.parallel", attrs=["dark"]))
|
10
|
+
|
7
11
|
TParallel = TypeVar("TParallel", bound="Parallel")
|
8
12
|
|
9
13
|
|
zrb/task/path_checker.py
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
from zrb.helper.accessories.color import colored
|
1
2
|
from zrb.helper.file.match import get_file_names
|
3
|
+
from zrb.helper.log import logger
|
2
4
|
from zrb.helper.typecheck import typechecked
|
3
5
|
from zrb.helper.typing import (
|
4
6
|
Any,
|
@@ -26,6 +28,8 @@ from zrb.task_env.env_file import EnvFile
|
|
26
28
|
from zrb.task_group.group import Group
|
27
29
|
from zrb.task_input.any_input import AnyInput
|
28
30
|
|
31
|
+
logger.debug(colored("Loading zrb.task.path_checker", attrs=["dark"]))
|
32
|
+
|
29
33
|
TPathChecker = TypeVar("TPathChecker", bound="PathChecker")
|
30
34
|
|
31
35
|
|
zrb/task/path_watcher.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import os
|
2
2
|
|
3
|
+
from zrb.helper.accessories.color import colored
|
3
4
|
from zrb.helper.file.match import get_file_names
|
5
|
+
from zrb.helper.log import logger
|
4
6
|
from zrb.helper.typecheck import typechecked
|
5
7
|
from zrb.helper.typing import (
|
6
8
|
Any,
|
@@ -29,6 +31,8 @@ from zrb.task_env.env_file import EnvFile
|
|
29
31
|
from zrb.task_group.group import Group
|
30
32
|
from zrb.task_input.any_input import AnyInput
|
31
33
|
|
34
|
+
logger.debug(colored("Loading zrb.task.path_watcher", attrs=["dark"]))
|
35
|
+
|
32
36
|
TPathWatcher = TypeVar("TPathWatcher", bound="PathWatcher")
|
33
37
|
|
34
38
|
|
zrb/task/port_checker.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
import socket
|
2
2
|
|
3
|
+
from zrb.helper.accessories.color import colored
|
4
|
+
from zrb.helper.log import logger
|
3
5
|
from zrb.helper.typecheck import typechecked
|
4
6
|
from zrb.helper.typing import (
|
5
7
|
Any,
|
@@ -26,6 +28,8 @@ from zrb.task_env.env_file import EnvFile
|
|
26
28
|
from zrb.task_group.group import Group
|
27
29
|
from zrb.task_input.any_input import AnyInput
|
28
30
|
|
31
|
+
logger.debug(colored("Loading zrb.task.port_checker", attrs=["dark"]))
|
32
|
+
|
29
33
|
TPortChecker = TypeVar("TPortChecker", bound="PortChecker")
|
30
34
|
|
31
35
|
|
zrb/task/recurring_task.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
import asyncio
|
2
2
|
import copy
|
3
3
|
|
4
|
+
from zrb.helper.accessories.color import colored
|
4
5
|
from zrb.helper.accessories.name import get_random_name
|
6
|
+
from zrb.helper.log import logger
|
5
7
|
from zrb.helper.typecheck import typechecked
|
6
8
|
from zrb.helper.typing import Any, Callable, Iterable, List, Mapping, Optional, Union
|
7
9
|
from zrb.task.any_task import AnyTask
|
@@ -20,6 +22,8 @@ from zrb.task_env.env_file import EnvFile
|
|
20
22
|
from zrb.task_group.group import Group
|
21
23
|
from zrb.task_input.any_input import AnyInput
|
22
24
|
|
25
|
+
logger.debug(colored("Loading zrb.task.recurring_task", attrs=["dark"]))
|
26
|
+
|
23
27
|
|
24
28
|
class RunConfig:
|
25
29
|
def __init__(
|
zrb/task/remote_cmd_task.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import os
|
2
2
|
import pathlib
|
3
3
|
|
4
|
+
from zrb.helper.accessories.color import colored
|
5
|
+
from zrb.helper.log import logger
|
4
6
|
from zrb.helper.typecheck import typechecked
|
5
7
|
from zrb.helper.typing import Any, Callable, Iterable, Optional, Union
|
6
8
|
from zrb.task.any_task import AnyTask
|
@@ -20,6 +22,8 @@ from zrb.task_env.env_file import EnvFile
|
|
20
22
|
from zrb.task_group.group import Group
|
21
23
|
from zrb.task_input.any_input import AnyInput
|
22
24
|
|
25
|
+
logger.debug(colored("Loading zrb.task.remote_cmd_task", attrs=["dark"]))
|
26
|
+
|
23
27
|
_CURRENT_DIR = os.path.dirname(__file__)
|
24
28
|
_SHELL_SCRIPT_DIR = os.path.join(_CURRENT_DIR, "..", "shell-scripts")
|
25
29
|
with open(os.path.join(_SHELL_SCRIPT_DIR, "ssh-util.sh")) as file:
|
zrb/task/resource_maker.py
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
from zrb.helper.accessories.color import colored
|
1
2
|
from zrb.helper.file.copy_tree import copy_tree
|
3
|
+
from zrb.helper.log import logger
|
2
4
|
from zrb.helper.typecheck import typechecked
|
3
5
|
from zrb.helper.typing import (
|
4
6
|
Any,
|
@@ -35,6 +37,8 @@ from zrb.task_env.env_file import EnvFile
|
|
35
37
|
from zrb.task_group.group import Group
|
36
38
|
from zrb.task_input.any_input import AnyInput
|
37
39
|
|
40
|
+
logger.debug(colored("Loading zrb.task.resource_maker", attrs=["dark"]))
|
41
|
+
|
38
42
|
Replacement = Mapping[str, JinjaTemplate]
|
39
43
|
ReplacementMutator = Callable[[AnyTask, Replacement], Replacement]
|
40
44
|
TResourceMaker = TypeVar("TResourceMaker", bound="ResourceMaker")
|
zrb/task/rsync_task.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import os
|
2
2
|
import pathlib
|
3
3
|
|
4
|
+
from zrb.helper.accessories.color import colored
|
5
|
+
from zrb.helper.log import logger
|
4
6
|
from zrb.helper.typecheck import typechecked
|
5
7
|
from zrb.helper.typing import Any, Callable, Iterable, JinjaTemplate, Optional, Union
|
6
8
|
from zrb.task.any_task import AnyTask
|
@@ -20,6 +22,8 @@ from zrb.task_env.env_file import EnvFile
|
|
20
22
|
from zrb.task_group.group import Group
|
21
23
|
from zrb.task_input.any_input import AnyInput
|
22
24
|
|
25
|
+
logger.debug(colored("Loading zrb.task.rsync_task", attrs=["dark"]))
|
26
|
+
|
23
27
|
_CURRENT_DIR = os.path.dirname(__file__)
|
24
28
|
_SHELL_SCRIPT_DIR = os.path.join(_CURRENT_DIR, "..", "shell-scripts")
|
25
29
|
with open(os.path.join(_SHELL_SCRIPT_DIR, "rsync-util.sh")) as file:
|
zrb/task/task.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
from zrb.helper.accessories.color import colored
|
2
|
+
from zrb.helper.log import logger
|
1
3
|
from zrb.helper.typecheck import typechecked
|
2
4
|
from zrb.task.base_task.base_task import BaseTask
|
3
5
|
|
6
|
+
logger.debug(colored("Loading zrb.task.task", attrs=["dark"]))
|
7
|
+
|
4
8
|
|
5
9
|
@typechecked
|
6
10
|
class Task(BaseTask):
|
zrb/task/time_watcher.py
CHANGED
@@ -2,6 +2,8 @@ import datetime
|
|
2
2
|
|
3
3
|
import croniter
|
4
4
|
|
5
|
+
from zrb.helper.accessories.color import colored
|
6
|
+
from zrb.helper.log import logger
|
5
7
|
from zrb.helper.typecheck import typechecked
|
6
8
|
from zrb.helper.typing import (
|
7
9
|
Any,
|
@@ -28,6 +30,8 @@ from zrb.task_env.env_file import EnvFile
|
|
28
30
|
from zrb.task_group.group import Group
|
29
31
|
from zrb.task_input.any_input import AnyInput
|
30
32
|
|
33
|
+
logger.debug(colored("Loading zrb.task.time_watcher", attrs=["dark"]))
|
34
|
+
|
31
35
|
TTimeWatcher = TypeVar("TTimeWatcher", bound="TimeWatcher")
|
32
36
|
|
33
37
|
|
zrb/task/wiki_task.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import os
|
2
2
|
|
3
3
|
from zrb.action.runner import Runner
|
4
|
+
from zrb.helper.accessories.color import colored
|
5
|
+
from zrb.helper.log import logger
|
4
6
|
from zrb.helper.task import show_lines
|
5
7
|
from zrb.helper.typecheck import typechecked
|
6
8
|
from zrb.helper.typing import Any, Callable, Iterable, List, Mapping, Optional, Union
|
@@ -21,6 +23,8 @@ from zrb.task_env.env_file import EnvFile
|
|
21
23
|
from zrb.task_group.group import Group
|
22
24
|
from zrb.task_input.any_input import AnyInput
|
23
25
|
|
26
|
+
logger.debug(colored("Loading zrb.task.wiki_task", attrs=["dark"]))
|
27
|
+
|
24
28
|
|
25
29
|
@typechecked
|
26
30
|
def create_wiki_tasks(
|
zrb/task_env/constant.py
CHANGED
zrb/task_env/env.py
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
import os
|
2
2
|
|
3
|
+
from zrb.helper.accessories.color import colored
|
4
|
+
from zrb.helper.log import logger
|
3
5
|
from zrb.helper.string.modification import double_quote
|
4
6
|
from zrb.helper.typecheck import typechecked
|
5
7
|
from zrb.helper.typing import JinjaTemplate, Optional
|
6
8
|
from zrb.task_env.constant import RESERVED_ENV_NAMES
|
7
9
|
|
10
|
+
logger.debug(colored("Loading zrb.task_env.env", attrs=["dark"]))
|
11
|
+
|
8
12
|
# flake8: noqa E501
|
9
13
|
|
10
14
|
|
zrb/task_env/env_file.py
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
from dotenv import dotenv_values
|
2
2
|
|
3
|
+
from zrb.helper.accessories.color import colored
|
4
|
+
from zrb.helper.log import logger
|
3
5
|
from zrb.helper.string.modification import double_quote
|
4
6
|
from zrb.helper.typecheck import typechecked
|
5
7
|
from zrb.helper.typing import List, Optional
|
6
8
|
from zrb.task_env.constant import RESERVED_ENV_NAMES
|
7
9
|
from zrb.task_env.env import Env
|
8
10
|
|
11
|
+
logger.debug(colored("Loading zrb.task_env.env_file", attrs=["dark"]))
|
12
|
+
|
9
13
|
# flake8: noqa E501
|
10
14
|
|
11
15
|
|
zrb/task_group/group.py
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
+
from zrb.helper.accessories.color import colored
|
2
|
+
from zrb.helper.log import logger
|
1
3
|
from zrb.helper.string.conversion import to_cli_name
|
2
4
|
from zrb.helper.string.modification import double_quote
|
3
5
|
from zrb.helper.typecheck import typechecked
|
4
6
|
from zrb.helper.typing import List, Optional, TypeVar
|
5
7
|
from zrb.task.any_task import AnyTask
|
6
8
|
|
9
|
+
logger.debug(colored("Loading zrb.task_group.group", attrs=["dark"]))
|
10
|
+
|
7
11
|
# flake8: noqa E501
|
8
12
|
TGroup = TypeVar("TGroup", bound="Group")
|
9
13
|
|
zrb/task_input/any_input.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
2
|
|
3
|
+
from zrb.helper.accessories.color import colored
|
4
|
+
from zrb.helper.log import logger
|
3
5
|
from zrb.helper.typing import Any, List, Mapping
|
4
6
|
|
7
|
+
logger.debug(colored("Loading zrb.task_input.any_input", attrs=["dark"]))
|
8
|
+
|
5
9
|
# flake8: noqa E501
|
6
10
|
|
7
11
|
|
zrb/task_input/base_input.py
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
from zrb.config.config import show_prompt
|
2
|
+
from zrb.helper.accessories.color import colored
|
3
|
+
from zrb.helper.log import logger
|
2
4
|
from zrb.helper.typecheck import typechecked
|
3
5
|
from zrb.helper.typing import Any, List, Mapping, Optional, Union
|
4
6
|
from zrb.task_input.any_input import AnyInput
|
5
7
|
from zrb.task_input.constant import RESERVED_INPUT_NAMES
|
6
8
|
|
9
|
+
logger.debug(colored("Loading zrb.task_input.base_input", attrs=["dark"]))
|
10
|
+
|
7
11
|
# flake8: noqa E501
|
8
12
|
|
9
13
|
|
zrb/task_input/bool_input.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
from zrb.helper.accessories.color import colored
|
2
|
+
from zrb.helper.log import logger
|
1
3
|
from zrb.helper.typecheck import typechecked
|
2
4
|
from zrb.helper.typing import Any, Optional, Union
|
3
5
|
from zrb.task_input.base_input import BaseInput
|
4
6
|
|
7
|
+
logger.debug(colored("Loading zrb.task_input.bool_input", attrs=["dark"]))
|
8
|
+
|
5
9
|
# flake8: noqa E501
|
6
10
|
|
7
11
|
|
zrb/task_input/choice_input.py
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
import click
|
2
2
|
|
3
|
+
from zrb.helper.accessories.color import colored
|
4
|
+
from zrb.helper.log import logger
|
3
5
|
from zrb.helper.typecheck import typechecked
|
4
6
|
from zrb.helper.typing import Any, Iterable, Optional, Union
|
5
7
|
from zrb.task_input.base_input import BaseInput
|
6
8
|
|
9
|
+
logger.debug(colored("Loading zrb.task_input.choice_input", attrs=["dark"]))
|
10
|
+
|
7
11
|
# flake8: noqa E501
|
8
12
|
|
9
13
|
|
zrb/task_input/constant.py
CHANGED
zrb/task_input/float_input.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
from zrb.helper.accessories.color import colored
|
2
|
+
from zrb.helper.log import logger
|
1
3
|
from zrb.helper.typecheck import typechecked
|
2
4
|
from zrb.helper.typing import Any, Optional, Union
|
3
5
|
from zrb.task_input.base_input import BaseInput
|
4
6
|
|
7
|
+
logger.debug(colored("Loading zrb.task_input.float_input", attrs=["dark"]))
|
8
|
+
|
5
9
|
# flake8: noqa E501
|
6
10
|
|
7
11
|
|