dotflow 0.8.0.dev1__tar.gz → 0.8.0.dev3__tar.gz
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.
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/PKG-INFO +1 -1
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/__init__.py +1 -1
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/cli/commands/__init__.py +2 -0
- dotflow-0.8.0.dev3/dotflow/cli/commands/init.py +16 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/cli/commands/start.py +11 -3
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/cli/setup.py +36 -15
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/execution.py +18 -7
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/settings.py +2 -2
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/pyproject.toml +2 -2
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/LICENSE +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/README.md +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/abc/__init__.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/abc/file.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/abc/http.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/abc/tcp.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/cli/__init__.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/cli/command.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/cli/commands/server.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/cli/validators/__init__.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/cli/validators/start.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/__init__.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/action.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/config.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/context.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/decorators/__init__.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/decorators/action.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/decorators/retry.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/decorators/time.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/dotflow.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/exception.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/models/__init__.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/models/execution.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/models/status.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/models/worflow.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/module.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/serializers/__init__.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/serializers/task.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/serializers/transport.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/serializers/workflow.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/task.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/utils/__init__.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/utils/basic_functions.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/utils/error_handler.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/utils/tools.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/core/workflow.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/log.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/main.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/providers/__init__.py +0 -0
- {dotflow-0.8.0.dev1 → dotflow-0.8.0.dev3}/dotflow/providers/zeromq.py +0 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"""Commands __init__ module."""
|
|
2
2
|
|
|
3
|
+
from dotflow.cli.commands.init import InitCommand
|
|
3
4
|
from dotflow.cli.commands.server import ServerCommand
|
|
4
5
|
from dotflow.cli.commands.start import StartCommand
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
__all__ = [
|
|
9
|
+
"InitCommand",
|
|
8
10
|
"ServerCommand",
|
|
9
11
|
"StartCommand"
|
|
10
12
|
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Command init module"""
|
|
2
|
+
|
|
3
|
+
from os import system, path
|
|
4
|
+
|
|
5
|
+
from dotflow.cli.command import Command
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class InitCommand(Command):
|
|
9
|
+
|
|
10
|
+
def __init__(self, **kwargs):
|
|
11
|
+
self.params = kwargs.get("arguments")
|
|
12
|
+
self.init()
|
|
13
|
+
|
|
14
|
+
def init(self):
|
|
15
|
+
if path.isfile(".gitignore"):
|
|
16
|
+
system("echo '\n\n# Dotflow\n.output' >> .gitignore")
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
"""Command
|
|
1
|
+
"""Command start module"""
|
|
2
|
+
|
|
3
|
+
from os import system
|
|
2
4
|
|
|
3
5
|
from dotflow import DotFlow, Config
|
|
6
|
+
from dotflow.core.models.execution import TypeExecution
|
|
4
7
|
from dotflow.cli.command import Command
|
|
5
8
|
|
|
6
9
|
|
|
@@ -14,7 +17,7 @@ class StartCommand(Command):
|
|
|
14
17
|
workflow = DotFlow(
|
|
15
18
|
config=Config(
|
|
16
19
|
path=self.params.path,
|
|
17
|
-
output=self.params.
|
|
20
|
+
output=self.params.output_context
|
|
18
21
|
)
|
|
19
22
|
)
|
|
20
23
|
|
|
@@ -24,4 +27,9 @@ class StartCommand(Command):
|
|
|
24
27
|
initial_context=self.params.initial_context
|
|
25
28
|
)
|
|
26
29
|
|
|
27
|
-
workflow.start(
|
|
30
|
+
workflow.start(
|
|
31
|
+
mode=self.params.mode
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
if self.params.mode == TypeExecution.BACKGROUND:
|
|
35
|
+
system("/bin/bash")
|
|
@@ -6,17 +6,15 @@ from dotflow import __version__, __description__
|
|
|
6
6
|
from dotflow.log import logger
|
|
7
7
|
from dotflow.settings import Settings as settings
|
|
8
8
|
from dotflow.core.utils.basic_functions import basic_callback
|
|
9
|
+
from dotflow.core.models.execution import TypeExecution
|
|
9
10
|
from dotflow.core.exception import (
|
|
10
11
|
MissingActionDecorator,
|
|
11
12
|
ExecutionModeNotExist,
|
|
12
13
|
StepMissingInit,
|
|
13
14
|
ModuleNotFound,
|
|
14
|
-
MESSAGE_UNKNOWN_ERROR
|
|
15
|
-
)
|
|
16
|
-
from dotflow.cli.commands import (
|
|
17
|
-
ServerCommand,
|
|
18
|
-
StartCommand
|
|
15
|
+
MESSAGE_UNKNOWN_ERROR,
|
|
19
16
|
)
|
|
17
|
+
from dotflow.cli.commands import InitCommand, ServerCommand, StartCommand
|
|
20
18
|
|
|
21
19
|
|
|
22
20
|
class Command:
|
|
@@ -31,30 +29,53 @@ class Command:
|
|
|
31
29
|
"--version",
|
|
32
30
|
action="version",
|
|
33
31
|
version=f"dotflow=={__version__}",
|
|
34
|
-
help="Show program's version number and exit."
|
|
32
|
+
help="Show program's version number and exit.",
|
|
35
33
|
)
|
|
36
34
|
|
|
35
|
+
self.setup_init()
|
|
37
36
|
self.setup_start()
|
|
38
37
|
self.command()
|
|
39
38
|
|
|
40
39
|
def setup_server(self):
|
|
41
40
|
self.cmd_server = self.subparsers.add_parser("server", help="Server")
|
|
42
|
-
self.cmd_server = self.cmd_server.add_argument_group(
|
|
41
|
+
self.cmd_server = self.cmd_server.add_argument_group(
|
|
42
|
+
"Usage: dotflow server [OPTIONS]"
|
|
43
|
+
)
|
|
43
44
|
self.cmd_server.set_defaults(exec=ServerCommand)
|
|
44
45
|
|
|
46
|
+
def setup_init(self):
|
|
47
|
+
self.cmd_init = self.subparsers.add_parser("init", help="Init")
|
|
48
|
+
self.cmd_init = self.cmd_init.add_argument_group(
|
|
49
|
+
"Usage: dotflow init [OPTIONS]"
|
|
50
|
+
)
|
|
51
|
+
self.cmd_init.set_defaults(exec=InitCommand)
|
|
52
|
+
|
|
45
53
|
def setup_start(self):
|
|
46
|
-
self.cmd_start = self.subparsers.add_parser("start", help="
|
|
47
|
-
self.cmd_start = self.cmd_start.add_argument_group(
|
|
54
|
+
self.cmd_start = self.subparsers.add_parser("start", help="Start")
|
|
55
|
+
self.cmd_start = self.cmd_start.add_argument_group(
|
|
56
|
+
"Usage: dotflow start [OPTIONS]"
|
|
57
|
+
)
|
|
48
58
|
|
|
49
59
|
self.cmd_start.add_argument("-s", "--step", required=True)
|
|
50
60
|
self.cmd_start.add_argument("-c", "--callback", default=basic_callback)
|
|
51
61
|
self.cmd_start.add_argument("-i", "--initial-context")
|
|
52
|
-
self.cmd_start.add_argument(
|
|
62
|
+
self.cmd_start.add_argument(
|
|
63
|
+
"-o", "--output-context", default=False, action="store_true"
|
|
64
|
+
)
|
|
53
65
|
self.cmd_start.add_argument("-p", "--path", default=settings.INITIAL_PATH)
|
|
66
|
+
self.cmd_start.add_argument(
|
|
67
|
+
"-m",
|
|
68
|
+
"--mode",
|
|
69
|
+
default=TypeExecution.SEQUENTIAL,
|
|
70
|
+
choices=[TypeExecution.SEQUENTIAL, TypeExecution.BACKGROUND],
|
|
71
|
+
)
|
|
54
72
|
|
|
55
73
|
self.cmd_start.set_defaults(exec=StartCommand)
|
|
56
74
|
|
|
57
75
|
def command(self):
|
|
76
|
+
message_icon = ":game_die:"
|
|
77
|
+
message_error = "[bold red]Error:[/bold red]"
|
|
78
|
+
|
|
58
79
|
try:
|
|
59
80
|
arguments = self.parser.parse_args()
|
|
60
81
|
if hasattr(arguments, "exec"):
|
|
@@ -62,17 +83,17 @@ class Command:
|
|
|
62
83
|
else:
|
|
63
84
|
print(__description__)
|
|
64
85
|
except MissingActionDecorator as err:
|
|
65
|
-
print(
|
|
86
|
+
print(message_icon, message_error, err)
|
|
66
87
|
|
|
67
88
|
except ExecutionModeNotExist as err:
|
|
68
|
-
print(
|
|
89
|
+
print(message_icon, message_error, err)
|
|
69
90
|
|
|
70
91
|
except StepMissingInit as err:
|
|
71
|
-
print(
|
|
92
|
+
print(message_icon, message_error, err)
|
|
72
93
|
|
|
73
94
|
except ModuleNotFound as err:
|
|
74
|
-
print(
|
|
95
|
+
print(message_icon, message_error, err)
|
|
75
96
|
|
|
76
97
|
except Exception as err:
|
|
77
|
-
print(
|
|
98
|
+
print(message_icon, message_error, MESSAGE_UNKNOWN_ERROR)
|
|
78
99
|
logger.error(err)
|
|
@@ -26,19 +26,30 @@ class Execution:
|
|
|
26
26
|
|
|
27
27
|
self._excution()
|
|
28
28
|
|
|
29
|
-
def _execution_with_class(self,
|
|
29
|
+
def _execution_with_class(self, class_instance: Callable):
|
|
30
30
|
context = Context(storage=[])
|
|
31
31
|
|
|
32
|
-
for func_name in dir(
|
|
33
|
-
additional_function = getattr(
|
|
32
|
+
for func_name in dir(class_instance):
|
|
33
|
+
additional_function = getattr(class_instance, func_name)
|
|
34
34
|
if isinstance(additional_function, Action):
|
|
35
35
|
try:
|
|
36
|
-
context.storage.append(
|
|
36
|
+
context.storage.append(
|
|
37
|
+
additional_function(
|
|
38
|
+
initial_context=self.task.initial_context,
|
|
39
|
+
previous_context=self.task.previous_context
|
|
40
|
+
)
|
|
41
|
+
)
|
|
37
42
|
except TypeError:
|
|
38
|
-
context.storage.append(
|
|
43
|
+
context.storage.append(
|
|
44
|
+
additional_function(
|
|
45
|
+
class_instance,
|
|
46
|
+
initial_context=self.task.initial_context,
|
|
47
|
+
previous_context=self.task.previous_context
|
|
48
|
+
)
|
|
49
|
+
)
|
|
39
50
|
|
|
40
51
|
if not context.storage:
|
|
41
|
-
return Context(storage=
|
|
52
|
+
return Context(storage=class_instance)
|
|
42
53
|
|
|
43
54
|
return context
|
|
44
55
|
|
|
@@ -52,7 +63,7 @@ class Execution:
|
|
|
52
63
|
|
|
53
64
|
if hasattr(current_context.storage.__init__, "__code__"):
|
|
54
65
|
current_context = self._execution_with_class(
|
|
55
|
-
|
|
66
|
+
class_instance=current_context.storage
|
|
56
67
|
)
|
|
57
68
|
|
|
58
69
|
self.task.status = TaskStatus.COMPLETED
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dotflow"
|
|
3
|
-
version = "0.8.0.
|
|
3
|
+
version = "0.8.0.dev3"
|
|
4
4
|
authors = [
|
|
5
5
|
{ name="Fernando Celmer", email="email@fernandocelmer.com" },
|
|
6
6
|
]
|
|
@@ -31,7 +31,7 @@ Documentation = "https://github.com/dotflow-io/dotflow/blob/master/README.md"
|
|
|
31
31
|
|
|
32
32
|
[tool.poetry]
|
|
33
33
|
name = "dotflow"
|
|
34
|
-
version = "0.8.0.
|
|
34
|
+
version = "0.8.0.dev3"
|
|
35
35
|
description = "🎲 Dotflow turns an idea into flow!"
|
|
36
36
|
authors = ["Fernando Celmer <email@fernandocelmer.com>"]
|
|
37
37
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|