orionis 0.451.0__py3-none-any.whl → 0.453.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,12 +7,14 @@ 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
15
15
 
16
+ from orionis.services.log.contracts.log_service import ILoggerService
17
+
16
18
  class Reactor:
17
19
 
18
20
  def __init__(
@@ -66,6 +68,12 @@ class Reactor:
66
68
  # Initialize the executor for command output management
67
69
  self.__executer: IExecutor = self.__app.make('x-orionis.console.output.executor')
68
70
 
71
+ # Initialize the console for command output
72
+ self.__console: IConsole = self.__app.make('x-orionis.console.output.console')
73
+
74
+ # Initialize the logger service for logging command execution details
75
+ self.__logger: ILoggerService = self.__app.make('x-orionis.services.log.log_service')
76
+
69
77
  def __loadCommands(self, commands_path: str, root_path: str) -> None:
70
78
  """
71
79
  Loads command classes from Python files in the specified commands directory.
@@ -401,21 +409,39 @@ class Reactor:
401
409
  try:
402
410
 
403
411
  # 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'))
412
+ command_instance: IBaseCommand = self.__app.make(command_class)
413
+
414
+ # If arguments were parsed, set them on the command instance
415
+ if isinstance(parsed_args, argparse.Namespace):
416
+ command_instance._args = vars(parsed_args)
417
+ elif isinstance(parsed_args, dict):
418
+ command_instance._args = parsed_args
419
+ else:
420
+ command_instance._args = {}
421
+
422
+ # Call the handle method of the command instance
423
+ output = self.__app.call(command_instance, 'handle')
407
424
 
408
425
  # Log the command execution completion with DONE state
409
426
  if timestamps:
410
427
  elapsed_time = round(time.perf_counter() - start_time, 2)
411
428
  self.__executer.done(program=signature, time=f"{elapsed_time}s")
412
429
 
430
+ # Log the command execution success
431
+ self.__logger.info(f"Command '{signature}' executed successfully in ({elapsed_time}) seconds.")
432
+
413
433
  # If the command has a return value or output, return it
414
434
  if output is not None:
415
435
  return output
416
436
 
417
437
  except Exception as e:
418
438
 
439
+ # Display the error message in the console
440
+ self.__console.error(f"An error occurred while executing command '{signature}': {e}", timestamp=False)
441
+
442
+ # Log the error in the logger service
443
+ self.__logger.error(f"Command '{signature}' execution failed: {e}")
444
+
419
445
  # Log the command execution failure with ERROR state
420
446
  if timestamps:
421
447
  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.453.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.453.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=nfts3Tuvz5GHhavN3AmFjSM2uxJDV8yh_xQP1JMgd9A,19265
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=Yydz9pUk2t1eQMGQc4uRQ9sN3Yuqg26Q4mjWpxGSktM,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.453.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.453.0.dist-info/METADATA,sha256=2l6AHDIa0Uv_iDNRBUqX-k7yrNBwlTyuSR3Z8zUp4Mc,4772
492
+ orionis-0.453.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
493
+ orionis-0.453.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
494
+ orionis-0.453.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
495
+ orionis-0.453.0.dist-info/RECORD,,