orionis 0.82.0__py3-none-any.whl → 0.85.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.82.0"
8
+ VERSION = "0.85.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
@@ -8,6 +8,7 @@ from orionis.luminate.providers.commands.reactor_commands_service_provider impor
8
8
  from orionis.luminate.providers.environment.environment__service_provider import EnvironmentServiceProvider
9
9
  from orionis.luminate.providers.config.config_service_provider import ConfigServiceProvider
10
10
  from orionis.luminate.providers.log.log_service_provider import LogServiceProvider
11
+ from orionis.luminate.facades.commands.commands_facade import Command
11
12
 
12
13
  class Application(metaclass=SingletonMeta):
13
14
  """
@@ -56,6 +57,7 @@ class Application(metaclass=SingletonMeta):
56
57
  # Initialize the application container
57
58
  self.container = container
58
59
  self.container.instance(container)
60
+ self.boot()
59
61
 
60
62
  def isBooted(self) -> bool:
61
63
  """
@@ -80,7 +82,7 @@ class Application(metaclass=SingletonMeta):
80
82
  Returns:
81
83
  str: The unique key generated for the callable.
82
84
  """
83
- self.container.bind(concrete)
85
+ return self.container.bind(concrete)
84
86
 
85
87
  def transient(self, concrete: Callable[..., Any]) -> str:
86
88
  """
@@ -91,7 +93,7 @@ class Application(metaclass=SingletonMeta):
91
93
  Returns:
92
94
  str: The unique key generated for the callable.
93
95
  """
94
- self.container.transient(concrete)
96
+ return self.container.transient(concrete)
95
97
 
96
98
  def singleton(self, concrete: Callable[..., Any]) -> str:
97
99
  """
@@ -104,7 +106,7 @@ class Application(metaclass=SingletonMeta):
104
106
  Returns:
105
107
  str: The key under which the singleton is registered in the container.
106
108
  """
107
- self.container.singleton(concrete)
109
+ return self.container.singleton(concrete)
108
110
 
109
111
  def scoped(self, concrete: Callable[..., Any]) -> str:
110
112
  """
@@ -117,7 +119,7 @@ class Application(metaclass=SingletonMeta):
117
119
  Returns:
118
120
  str: The key under which the callable is registered in the scoped services dictionary.
119
121
  """
120
- self.container.scoped(concrete)
122
+ return self.container.scoped(concrete)
121
123
 
122
124
  def instance(self, instance: Any) -> str:
123
125
  """
@@ -127,7 +129,7 @@ class Application(metaclass=SingletonMeta):
127
129
  Returns:
128
130
  str: The key under which the instance is registered in the container.
129
131
  """
130
- self.container.instance(instance)
132
+ return self.container.instance(instance)
131
133
 
132
134
  def alias(self, alias: str, concrete: Any) -> None:
133
135
  """
@@ -138,7 +140,7 @@ class Application(metaclass=SingletonMeta):
138
140
  Raises:
139
141
  OrionisContainerException: If the concrete instance is not a valid object or if the alias is a primitive type.
140
142
  """
141
- self.container.alias(alias, concrete)
143
+ return self.container.alias(alias, concrete)
142
144
 
143
145
  def has(self, obj: Any) -> bool:
144
146
  """
@@ -154,7 +156,7 @@ class Application(metaclass=SingletonMeta):
154
156
  bool
155
157
  True if the service is registered, False otherwise.
156
158
  """
157
- self.container.has(obj)
159
+ return self.container.has(obj)
158
160
 
159
161
  def make(self, abstract: Any) -> Any:
160
162
  """
@@ -175,13 +177,13 @@ class Application(metaclass=SingletonMeta):
175
177
  OrionisContainerException
176
178
  If the service is not found in the container.
177
179
  """
178
- self.container.make(abstract)
180
+ return self.container.make(abstract)
179
181
 
180
182
  def forgetScopedInstances(self) -> None:
181
183
  """
182
184
  Reset scoped instances at the beginning of a new request.
183
185
  """
184
- self.container.forgetScopedInstances()
186
+ return self.container.forgetScopedInstances()
185
187
 
186
188
  def boot(self):
187
189
  """
@@ -58,6 +58,36 @@ class ReactorCommandsService(IReactorCommandsService):
58
58
  except Exception as e:
59
59
  raise ValueError(f"Error parsing arguments: {e}")
60
60
 
61
+ def _extract_arguments(self, args_dict:Any):
62
+ """
63
+ Extracts the arguments from the provided dictionary.
64
+
65
+ Parameters
66
+ ----------
67
+ args_dict : Any
68
+ A dictionary containing the arguments to extract.
69
+ """
70
+ try:
71
+ return vars(args_dict)
72
+ except Exception as e:
73
+ raise ValueError(f"Error parsing arguments: {e}")
74
+
75
+ def _call(self, signature: str, args_dict: Any) -> Any:
76
+ """
77
+ Executes the specified command with the provided arguments.
78
+
79
+ Parameters
80
+ ----------
81
+ signature : str
82
+ The command signature (name) to execute.
83
+ args_dict : Any
84
+ A dictionary containing named arguments for the command.
85
+ """
86
+
87
+ command_instance: BaseCommand = app(signature)
88
+ command_instance.setArgs(args_dict)
89
+ return command_instance.handle(**self._extract_arguments(args_dict))
90
+
61
91
  def execute(self, signature: Optional[str] = None, vars: dict = {}, *args, **kwargs):
62
92
  """
63
93
  Processes and executes a CLI command.
@@ -94,10 +124,8 @@ class ReactorCommandsService(IReactorCommandsService):
94
124
  # Parse command arguments dynamically based on execution context
95
125
  args_dict = self._parse_arguments(command.get('arguments', []), vars, *args, **kwargs)
96
126
 
97
- # Instantiate command and execute it
98
- command_instance: BaseCommand = app(signature)
99
- command_instance.setArgs(args_dict)
100
- output = command_instance.handle(**vars(args_dict))
127
+ # Exception handling for command execution
128
+ output = self._call(signature, args_dict)
101
129
 
102
130
  # Log successful command execution
103
131
  self.log.success(f"Command executed successfully: {signature}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: orionis
3
- Version: 0.82.0
3
+ Version: 0.85.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=czq_vQU4HeqXvnXqiNgD86PKF5N3Y6j1B2bj74FNMag,1386
3
+ orionis/framework.py,sha256=1GSl1yFDWM4AkBveAmJ7jmYcRVltYmhWrUTc1KszQTg,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
@@ -60,7 +60,7 @@ orionis/installer/installer_manager.py,sha256=Hb6T0bmSl39T30maY-nUWkrLhG77JdrKe4
60
60
  orionis/installer/installer_output.py,sha256=LeKxzuXpnHOKbKpUtx3tMGkCi2bGcPV1VNnfBxwfxUU,7161
61
61
  orionis/installer/installer_setup.py,sha256=c2HtVklSa-2_-YVonc7fwtoK-RTDqBS2Ybvbekgfqtc,6970
62
62
  orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
- orionis/luminate/app.py,sha256=_kMCDsUX6A5XN0bCv847F3d6hDEGobHlinfi-38Donk,11545
63
+ orionis/luminate/app.py,sha256=9eX3b6I8Qpo12jSMyALh2Zo_yV5F9d5Yb1U16KCq9QI,11700
64
64
  orionis/luminate/app_context.py,sha256=XREVkOHU6aP8UB2daA2QbFcOCB8HRmcGXjVbrlW1AHQ,1827
65
65
  orionis/luminate/bootstrap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
66
  orionis/luminate/bootstrap/command_bootstrapper.py,sha256=JJkWWOS2R2Zg7mC7-VMtZ0wAgxlegMkdnqudpbAjxwk,6925
@@ -131,7 +131,7 @@ orionis/luminate/providers/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
131
131
  orionis/luminate/providers/log/log_service_provider.py,sha256=tcWDEI-fubi1mWSS-IKiRReuc0pRMHpxvbvuDgs2Uy0,654
132
132
  orionis/luminate/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
133
133
  orionis/luminate/services/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
- orionis/luminate/services/commands/reactor_commands_service.py,sha256=913caIBsrbjfVh2oPXLKNMGnSRTFPAn4V9vwbGmV-is,5490
134
+ orionis/luminate/services/commands/reactor_commands_service.py,sha256=UgWBPsApDpZPJOqgMa0wd0v9H9ACOYtf8fOjiD3KpJw,6347
135
135
  orionis/luminate/services/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
136
136
  orionis/luminate/services/config/config_service.py,sha256=sVqX3UBxZA5whjiVFgfo5fzAb8QxD0NT0OYYlgZUK0g,2223
137
137
  orionis/luminate/services/environment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -160,9 +160,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
161
161
  tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
162
162
  tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
163
- orionis-0.82.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
164
- orionis-0.82.0.dist-info/METADATA,sha256=9Xe_QyLbOju0fAyHCnNS1APyEiDBNx5uxCNoUHqNX5o,2978
165
- orionis-0.82.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
166
- orionis-0.82.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
167
- orionis-0.82.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
168
- orionis-0.82.0.dist-info/RECORD,,
163
+ orionis-0.85.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
164
+ orionis-0.85.0.dist-info/METADATA,sha256=QgGX7Xz0JJYxLpirp2qdKDpeOYSLDZWdDk8ZIHrGdRU,2978
165
+ orionis-0.85.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
166
+ orionis-0.85.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
167
+ orionis-0.85.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
168
+ orionis-0.85.0.dist-info/RECORD,,