orionis 0.451.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.
@@ -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)
@@ -1579,8 +1579,12 @@ class Container(IContainer):
1579
1579
  if dependency.default is not None:
1580
1580
  return dependency.default
1581
1581
 
1582
+ # If the dependency is a built-in type with a default value, return it
1583
+ if dependency.module_name == 'builtins' and dependency.resolved:
1584
+ return dependency.default
1585
+
1582
1586
  # If the dependency is a built-in type, raise an exception
1583
- if dependency.module_name == 'builtins':
1587
+ elif dependency.module_name == 'builtins' and not dependency.resolved:
1584
1588
  raise OrionisContainerException(
1585
1589
  f"Cannot resolve '{name}' because parameter '{param_name}' depends on built-in type '{dependency.type.__name__}'."
1586
1590
  )
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.451.0"
8
+ VERSION = "0.452.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.451.0
3
+ Version: 0.452.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -15,7 +15,7 @@ orionis/console/commands/version.py,sha256=kR8xzyc-Wisk7AXqg3Do7M9xTg_CxJgAtESPG
15
15
  orionis/console/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  orionis/console/contracts/kernel.py,sha256=mh4LlhEYHh3FuGZZQ0GBhD6ZLa5YQvaNj2r01IIHI5Y,826
17
17
  orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- orionis/console/core/reactor.py,sha256=oal0RcDvZgZDqIHDeQ0PT1U9bEKjN6DBopob4yBZ1bc,18073
18
+ orionis/console/core/reactor.py,sha256=ZO_-cxT5PeGwIIIkX6cf5jdSZcU_GmR-N_CQZAJp6xo,18722
19
19
  orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  orionis/console/dumper/dump.py,sha256=CATERiQ6XuIrKQsDaWcVxzTtlAJI9qLJX44fQxEX8ws,22443
21
21
  orionis/console/dumper/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -38,7 +38,7 @@ orionis/console/output/contracts/executor.py,sha256=7l3kwnvv6GlH9EYk0v94YE1olex_
38
38
  orionis/console/output/enums/__init__.py,sha256=LAaAxg-DpArCjf_jqZ0_9s3p8899gntDYkSU_ppTdC8,66
39
39
  orionis/console/output/enums/styles.py,sha256=6a4oQCOBOKMh2ARdeq5GlIskJ3wjiylYmh66tUKKmpQ,4053
40
40
  orionis/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
- orionis/container/container.py,sha256=SYXNG43_C0LsgaY32IucbYocJHMuoJzPIIMXEMKtxtI,80303
41
+ orionis/container/container.py,sha256=MmvFm0Y-x667mIYPunmBnHzQHBsWJObT5_zuWrgqaWU,80528
42
42
  orionis/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  orionis/container/context/manager.py,sha256=I08K_jKXSKmrq18Pv33qYyMKIlAovVOwIgmfiVm-J7c,2971
44
44
  orionis/container/context/scope.py,sha256=p_oCzR7dDz-5ZAd16ab4vfLc3gBf34CaN0f4iR9D0bQ,1155
@@ -180,7 +180,7 @@ orionis/foundation/providers/progress_bar_provider.py,sha256=X4Ke7mPr0MgVp6WDNaQ
180
180
  orionis/foundation/providers/testing_provider.py,sha256=YTubcNnWrG3SPx5NM5HgYefvUYoXdlzXcjljnjavUwM,6462
181
181
  orionis/foundation/providers/workers_provider.py,sha256=5CvlUETdIblh7Wx8pT0MswTeTCGhYah-EvFqOrLu8Mo,4113
182
182
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
183
- orionis/metadata/framework.py,sha256=nZIjGI1zBkVtVi-1ZXlbDNPq2bJCsAMvDWF0C4aWtD0,4088
183
+ orionis/metadata/framework.py,sha256=qViT8S9jeidebRmAlkNeMjxIr-mOqkdYmxxWyJn_9aE,4088
184
184
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
185
185
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
186
186
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -345,7 +345,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
345
345
  orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
346
346
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
347
347
  orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
348
- orionis-0.451.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
348
+ orionis-0.452.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
349
349
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
350
350
  tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
351
351
  tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -488,8 +488,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
488
488
  tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
489
489
  tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
490
490
  tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
491
- orionis-0.451.0.dist-info/METADATA,sha256=lcxa9cXizRq5Ui6Vw6UtmqUJnCN7UU14fsqsK3fOvOY,4772
492
- orionis-0.451.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
493
- orionis-0.451.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
494
- orionis-0.451.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
495
- orionis-0.451.0.dist-info/RECORD,,
491
+ orionis-0.452.0.dist-info/METADATA,sha256=c4noEIg-Ztb5R__sDjWTYfgBW08FLrPJtnuhChhxDN8,4772
492
+ orionis-0.452.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
493
+ orionis-0.452.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
494
+ orionis-0.452.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
495
+ orionis-0.452.0.dist-info/RECORD,,