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.
Files changed (43) hide show
  1. orionis/console/base/contracts/command.py +0 -2
  2. orionis/console/core/__init__.py +0 -0
  3. orionis/console/core/reactor.py +19 -4
  4. orionis/container/container.py +1581 -69
  5. orionis/container/contracts/container.py +184 -33
  6. orionis/foundation/config/database/entities/mysql.py +0 -1
  7. orionis/metadata/framework.py +1 -1
  8. orionis/services/inspirational/contracts/__init__.py +0 -0
  9. orionis/services/introspection/abstract/contracts/reflection.py +5 -6
  10. orionis/services/introspection/abstract/reflection.py +5 -6
  11. orionis/services/introspection/callables/contracts/reflection.py +3 -2
  12. orionis/services/introspection/callables/reflection.py +4 -4
  13. orionis/services/introspection/concretes/contracts/reflection.py +5 -6
  14. orionis/services/introspection/concretes/reflection.py +5 -6
  15. orionis/services/introspection/dependencies/contracts/reflection.py +87 -23
  16. orionis/services/introspection/dependencies/entities/argument.py +95 -0
  17. orionis/services/introspection/dependencies/entities/resolve_argument.py +82 -0
  18. orionis/services/introspection/dependencies/reflection.py +176 -106
  19. orionis/services/introspection/instances/contracts/reflection.py +5 -6
  20. orionis/services/introspection/instances/reflection.py +5 -6
  21. orionis/test/core/unit_test.py +150 -48
  22. {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/METADATA +1 -1
  23. {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/RECORD +35 -38
  24. tests/container/mocks/mock_auto_resolution.py +192 -0
  25. tests/services/introspection/dependencies/test_reflect_dependencies.py +135 -58
  26. tests/services/introspection/reflection/test_reflection_abstract.py +5 -4
  27. tests/services/introspection/reflection/test_reflection_callable.py +3 -3
  28. tests/services/introspection/reflection/test_reflection_concrete.py +4 -4
  29. tests/services/introspection/reflection/test_reflection_instance.py +5 -5
  30. orionis/console/args/parser.py +0 -40
  31. orionis/container/contracts/resolver.py +0 -115
  32. orionis/container/resolver/resolver.py +0 -602
  33. orionis/services/introspection/dependencies/entities/callable_dependencies.py +0 -54
  34. orionis/services/introspection/dependencies/entities/class_dependencies.py +0 -61
  35. orionis/services/introspection/dependencies/entities/known_dependencies.py +0 -67
  36. orionis/services/introspection/dependencies/entities/method_dependencies.py +0 -61
  37. tests/container/resolver/test_resolver.py +0 -62
  38. /orionis/{container/resolver → console/commands}/__init__.py +0 -0
  39. {tests/container/resolver → orionis/console/contracts}/__init__.py +0 -0
  40. {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/WHEEL +0 -0
  41. {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/licenses/LICENCE +0 -0
  42. {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/top_level.txt +0 -0
  43. {orionis-0.450.0.dist-info → orionis-0.452.0.dist-info}/zip-safe +0 -0
@@ -1,7 +1,5 @@
1
-
2
1
  from abc import ABC, abstractmethod
3
2
  from typing import Any, Dict, List
4
-
5
3
  from orionis.console.args.argument import CLIArgument
6
4
 
7
5
  class IBaseCommand(ABC):
File without changes
@@ -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
- command_instance._args = vars(parsed_args) if parsed_args else {}
406
- output = command_instance.handle(self.__app.make('x-orionis.services.inspirational.inspire'))
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)