orionis 0.70.0__py3-none-any.whl → 0.72.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/framework.py CHANGED
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.70.0"
8
+ VERSION = "0.72.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
orionis/luminate/app.py CHANGED
@@ -7,16 +7,16 @@ from orionis.luminate.providers.environment.environment_provider import Environm
7
7
 
8
8
  class Application(metaclass=SingletonMeta):
9
9
 
10
- def __init__(self):
10
+ def __init__(self, container: Container):
11
11
 
12
12
  # Atributos de la clase
13
13
  self._config = {}
14
14
  self._commands = {}
15
- self._environment = {}
15
+ self._environment_vars = {}
16
16
 
17
17
  # Inicializar el contenedor de la aplicacion
18
- self.container = Container()
19
- self.container.instance(self.container)
18
+ self.container = container
19
+ self.container.instance(container)
20
20
 
21
21
  # Cargar el servidor de entorno
22
22
  self._loadServiceProviderEnvironment()
@@ -24,6 +24,9 @@ class Application(metaclass=SingletonMeta):
24
24
  # Cargar dinamicamente la configurcion de la aplicacion.
25
25
  self._bootstraping()
26
26
 
27
+ # Registrrar los comandos en el contenedor
28
+ self._registerCommands()
29
+
27
30
  def _loadServiceProviderEnvironment(self):
28
31
 
29
32
  # Cargar el proveedor de entorno
@@ -46,6 +49,11 @@ class Application(metaclass=SingletonMeta):
46
49
  # Cargar las variables de entorno solo desde el archivo .env (No se carga desde el sistema operativo, por seguridad)
47
50
  environment_bootstrapper_key = self.container.singleton(EnvironmentBootstrapper)
48
51
  environment_bootstrapper: EnvironmentBootstrapper = self.container.make(environment_bootstrapper_key)
49
- self._environment = environment_bootstrapper.get()
52
+ self._environment_vars = environment_bootstrapper.get()
53
+
54
+ def _registerCommands(self):
50
55
 
51
- print(self._config)
56
+ # Registrar los comandos en el contenedor
57
+ for command in self._commands:
58
+ _key_instance_container = self.container.bind(self._commands[command].get('concrete'))
59
+ self.container.alias(alias=command, concrete=_key_instance_container)
@@ -248,13 +248,16 @@ class Container(IContainer):
248
248
  Raises:
249
249
  OrionisContainerException: If the concrete instance is not a valid object or if the alias is a primitive type.
250
250
  """
251
- if not callable(concrete) and not isinstance(concrete, object):
252
- raise OrionisContainerException(f"The instance '{str(concrete)}' must be a valid object.")
253
251
 
254
252
  if self._instance._validate_types.isPrimitive(alias):
255
253
  raise OrionisContainerException(f"Cannot use primitive type '{alias}' as an alias.")
256
254
 
257
- if isinstance(concrete, object) and concrete.__class__.__module__ not in ['builtins', 'abc']:
255
+ if isinstance(concrete, str):
256
+ if self.has(concrete):
257
+ current_key = concrete
258
+ else:
259
+ raise OrionisContainerException(f"Service '{concrete}' is not registered in the container.")
260
+ elif isinstance(concrete, object) and concrete.__class__.__module__ not in ['builtins', 'abc']:
258
261
  cls_concrete = concrete.__class__
259
262
  current_key = f"{cls_concrete.__module__}.{cls_concrete.__name__}"
260
263
  elif callable(concrete):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: orionis
3
- Version: 0.70.0
3
+ Version: 0.72.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
@@ -1,6 +1,6 @@
1
1
  orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  orionis/cli_manager.py,sha256=0bM-hABXJSoPGuvEgnqeaj9qcLP8VjTQ3z9Mb0TSEUI,1381
3
- orionis/framework.py,sha256=X0Emcz86KeiYNUZkHybLDkL0DA4OOjMEpgp6KquLfrw,1386
3
+ orionis/framework.py,sha256=qoKw9PXLHyVH-BLmh4czvAvZJgLFRSl8LNlap7VLELE,1386
4
4
  orionis/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  orionis/contracts/bootstrap/i_command_bootstrapper.py,sha256=cfpYWSlNhOY1q_C9o0H7F381OoM0Oh0qaeqP-c85nzk,2457
6
6
  orionis/contracts/bootstrap/i_config_bootstrapper.py,sha256=d2TXT74H2fCBbzWgrt9-ZG11S_H_YPQOEcJoIOrsgb0,4462
@@ -56,7 +56,7 @@ orionis/installer/installer_manager.py,sha256=Hb6T0bmSl39T30maY-nUWkrLhG77JdrKe4
56
56
  orionis/installer/installer_output.py,sha256=LeKxzuXpnHOKbKpUtx3tMGkCi2bGcPV1VNnfBxwfxUU,7161
57
57
  orionis/installer/installer_setup.py,sha256=c2HtVklSa-2_-YVonc7fwtoK-RTDqBS2Ybvbekgfqtc,6970
58
58
  orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
- orionis/luminate/app.py,sha256=KHmx5YBiBX2LD-4k8YwUbwOEDv4Ke19rD-5aMLxvIx0,2286
59
+ orionis/luminate/app.py,sha256=MRB7235NLj2gKba1xqScpYiTs87nowllTIpVKXtOXVs,2682
60
60
  orionis/luminate/app_context.py,sha256=XREVkOHU6aP8UB2daA2QbFcOCB8HRmcGXjVbrlW1AHQ,1827
61
61
  orionis/luminate/bootstrap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  orionis/luminate/bootstrap/command_bootstrapper.py,sha256=OU0hDMtG1xqVbvCneq4C5mlOUu9OmfkxqbvGH59QsUw,6919
@@ -97,7 +97,7 @@ orionis/luminate/console/output/progress_bar.py,sha256=ssi8Drryr-shl7OxweTgGOhvR
97
97
  orionis/luminate/console/output/styles.py,sha256=2e1_FJdNpKaVqmdlCx-udzTleH_6uEFE9_TjH7T1ZUk,3696
98
98
  orionis/luminate/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
99
  orionis/luminate/console/tasks/scheduler.py,sha256=zt4p2VGUYGGrG2-E-MxyheKjBqGDJB2c0irULDsBgIw,22678
100
- orionis/luminate/container/container.py,sha256=SKC7IyiAaeySiSvlRbTZRTTe4i_Jvm2N8O9Di8It6_I,16350
100
+ orionis/luminate/container/container.py,sha256=RlGsAgUqSZa2bAvaxCtD3babXNUse7f3t9dDjz1scSg,16419
101
101
  orionis/luminate/container/exception.py,sha256=ap1SqYEjQEEHXJJTNmL7V1jrmRjgT5_7geZ95MYkhMA,1691
102
102
  orionis/luminate/container/types.py,sha256=BDcXN0__voRNHZ5Gr5dF0sWIYAQyNk4TxAwILBWyDAA,1735
103
103
  orionis/luminate/facades/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -153,9 +153,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
153
153
  tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
154
154
  tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
155
155
  tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
156
- orionis-0.70.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
157
- orionis-0.70.0.dist-info/METADATA,sha256=YvDFh8uQw1pFuqduGSMEkhUCX1lh2mfDboTFjZ--KbU,2978
158
- orionis-0.70.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
159
- orionis-0.70.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
160
- orionis-0.70.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
161
- orionis-0.70.0.dist-info/RECORD,,
156
+ orionis-0.72.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
157
+ orionis-0.72.0.dist-info/METADATA,sha256=VbZCB0SHkobPg1dIxZA2g6Or8nHd8cjrzOkf62QRV7o,2978
158
+ orionis-0.72.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
159
+ orionis-0.72.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
160
+ orionis-0.72.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
161
+ orionis-0.72.0.dist-info/RECORD,,