orionis 0.450.0__py3-none-any.whl → 0.452.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.
- orionis/console/base/contracts/command.py +0 -2
- orionis/console/core/__init__.py +0 -0
- orionis/console/core/reactor.py +19 -4
- orionis/container/container.py +1581 -69
- orionis/container/contracts/container.py +184 -33
- orionis/foundation/config/database/entities/mysql.py +0 -1
- orionis/metadata/framework.py +1 -1
- orionis/services/inspirational/contracts/__init__.py +0 -0
- orionis/services/introspection/abstract/contracts/reflection.py +5 -6
- orionis/services/introspection/abstract/reflection.py +5 -6
- orionis/services/introspection/callables/contracts/reflection.py +3 -2
- orionis/services/introspection/callables/reflection.py +4 -4
- orionis/services/introspection/concretes/contracts/reflection.py +5 -6
- orionis/services/introspection/concretes/reflection.py +5 -6
- orionis/services/introspection/dependencies/contracts/reflection.py +87 -23
- orionis/services/introspection/dependencies/entities/argument.py +95 -0
- orionis/services/introspection/dependencies/entities/resolve_argument.py +82 -0
- orionis/services/introspection/dependencies/reflection.py +176 -106
- orionis/services/introspection/instances/contracts/reflection.py +5 -6
- orionis/services/introspection/instances/reflection.py +5 -6
- orionis/test/core/unit_test.py +150 -48
- {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/METADATA +1 -1
- {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/RECORD +35 -38
- tests/container/mocks/mock_auto_resolution.py +192 -0
- tests/services/introspection/dependencies/test_reflect_dependencies.py +135 -58
- tests/services/introspection/reflection/test_reflection_abstract.py +5 -4
- tests/services/introspection/reflection/test_reflection_callable.py +3 -3
- tests/services/introspection/reflection/test_reflection_concrete.py +4 -4
- tests/services/introspection/reflection/test_reflection_instance.py +5 -5
- orionis/console/args/parser.py +0 -40
- orionis/container/contracts/resolver.py +0 -115
- orionis/container/resolver/resolver.py +0 -602
- orionis/services/introspection/dependencies/entities/callable_dependencies.py +0 -54
- orionis/services/introspection/dependencies/entities/class_dependencies.py +0 -61
- orionis/services/introspection/dependencies/entities/known_dependencies.py +0 -67
- orionis/services/introspection/dependencies/entities/method_dependencies.py +0 -61
- tests/container/resolver/test_resolver.py +0 -62
- /orionis/{container/resolver → console/commands}/__init__.py +0 -0
- {tests/container/resolver → orionis/console/contracts}/__init__.py +0 -0
- {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/WHEEL +0 -0
- {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/top_level.txt +0 -0
- {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/zip-safe +0 -0
|
File without changes
|
orionis/console/core/reactor.py
CHANGED
|
@@ -7,8 +7,8 @@ from orionis.app import Orionis
|
|
|
7
7
|
from orionis.console.args.argument import CLIArgument
|
|
8
8
|
from orionis.console.base.command import BaseCommand
|
|
9
9
|
from orionis.console.base.contracts.command import IBaseCommand
|
|
10
|
+
from orionis.console.output.contracts.console import IConsole
|
|
10
11
|
from orionis.console.output.contracts.executor import IExecutor
|
|
11
|
-
from orionis.console.output.executor import Executor
|
|
12
12
|
from orionis.foundation.contracts.application import IApplication
|
|
13
13
|
from orionis.services.introspection.modules.reflection import ReflectionModule
|
|
14
14
|
import re
|
|
@@ -66,6 +66,9 @@ class Reactor:
|
|
|
66
66
|
# Initialize the executor for command output management
|
|
67
67
|
self.__executer: IExecutor = self.__app.make('x-orionis.console.output.executor')
|
|
68
68
|
|
|
69
|
+
# Initialize the console for command output
|
|
70
|
+
self.__console: IConsole = self.__app.make('x-orionis.console.output.console')
|
|
71
|
+
|
|
69
72
|
def __loadCommands(self, commands_path: str, root_path: str) -> None:
|
|
70
73
|
"""
|
|
71
74
|
Loads command classes from Python files in the specified commands directory.
|
|
@@ -401,9 +404,18 @@ class Reactor:
|
|
|
401
404
|
try:
|
|
402
405
|
|
|
403
406
|
# Create an instance of the command class and execute it
|
|
404
|
-
command_instance: IBaseCommand = command_class
|
|
405
|
-
|
|
406
|
-
|
|
407
|
+
command_instance: IBaseCommand = self.__app.make(command_class)
|
|
408
|
+
|
|
409
|
+
# If arguments were parsed, set them on the command instance
|
|
410
|
+
if isinstance(parsed_args, argparse.Namespace):
|
|
411
|
+
command_instance._args = vars(parsed_args)
|
|
412
|
+
elif isinstance(parsed_args, dict):
|
|
413
|
+
command_instance._args = parsed_args
|
|
414
|
+
else:
|
|
415
|
+
command_instance._args = {}
|
|
416
|
+
|
|
417
|
+
# Call the handle method of the command instance
|
|
418
|
+
output = self.__app.call(command_instance, 'handle')
|
|
407
419
|
|
|
408
420
|
# Log the command execution completion with DONE state
|
|
409
421
|
if timestamps:
|
|
@@ -416,6 +428,9 @@ class Reactor:
|
|
|
416
428
|
|
|
417
429
|
except Exception as e:
|
|
418
430
|
|
|
431
|
+
# Display the error message in the console
|
|
432
|
+
self.__console.error(f"An error occurred while executing command '{signature}': {e}", timestamp=False)
|
|
433
|
+
|
|
419
434
|
# Log the command execution failure with ERROR state
|
|
420
435
|
if timestamps:
|
|
421
436
|
elapsed_time = round(time.perf_counter() - start_time, 2)
|