orionis 0.153.0__py3-none-any.whl → 0.155.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 +1 -1
- orionis/luminate/application.py +44 -65
- {orionis-0.153.0.dist-info → orionis-0.155.0.dist-info}/METADATA +1 -1
- {orionis-0.153.0.dist-info → orionis-0.155.0.dist-info}/RECORD +8 -8
- {orionis-0.153.0.dist-info → orionis-0.155.0.dist-info}/LICENCE +0 -0
- {orionis-0.153.0.dist-info → orionis-0.155.0.dist-info}/WHEEL +0 -0
- {orionis-0.153.0.dist-info → orionis-0.155.0.dist-info}/entry_points.txt +0 -0
- {orionis-0.153.0.dist-info → orionis-0.155.0.dist-info}/top_level.txt +0 -0
orionis/framework.py
CHANGED
orionis/luminate/application.py
CHANGED
@@ -150,12 +150,14 @@ class Application(metaclass=SingletonMeta):
|
|
150
150
|
provider: IServiceProvider = service(app=self._container)
|
151
151
|
provider.register()
|
152
152
|
|
153
|
-
# If the provider has a boot method, execute it (sync or async)
|
154
153
|
if hasattr(provider, 'boot') and callable(provider.boot):
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
154
|
+
try:
|
155
|
+
if inspect.iscoroutinefunction(provider.boot):
|
156
|
+
await provider.boot()
|
157
|
+
else:
|
158
|
+
provider.boot()
|
159
|
+
except Exception as e:
|
160
|
+
raise RuntimeError(f"Error booting service provider {service.__name__}: {e}") from e
|
159
161
|
|
160
162
|
def _bootstrapping(self) -> None:
|
161
163
|
"""
|
@@ -184,71 +186,48 @@ class Application(metaclass=SingletonMeta):
|
|
184
186
|
for command, data_command in self._commands.items():
|
185
187
|
self._container.transient(data_command.get('signature'), data_command.get('concrete'))
|
186
188
|
|
189
|
+
@contextmanager
|
190
|
+
def app_context():
|
191
|
+
"""
|
192
|
+
Context manager for creating an instance of the Orionis application.
|
187
193
|
|
194
|
+
This function initializes the Orionis application with a new container,
|
195
|
+
ensuring that the application is properly set up before use.
|
188
196
|
|
197
|
+
Yields
|
198
|
+
------
|
199
|
+
Application
|
200
|
+
The initialized Orionis application instance.
|
189
201
|
|
202
|
+
Raises
|
203
|
+
------
|
204
|
+
RuntimeError
|
205
|
+
If the application has not been properly initialized.
|
206
|
+
"""
|
207
|
+
try:
|
208
|
+
yield Application.getInstance()
|
209
|
+
finally:
|
210
|
+
pass
|
190
211
|
|
212
|
+
def app_booted():
|
213
|
+
"""
|
214
|
+
Check if the application has been booted.
|
191
215
|
|
216
|
+
Returns:
|
217
|
+
bool: True if the application has been booted, False otherwise.
|
218
|
+
"""
|
219
|
+
return Application.isRunning()
|
192
220
|
|
221
|
+
def orionis():
|
222
|
+
"""
|
223
|
+
Creates a new instance of the Orionis application.
|
193
224
|
|
225
|
+
Returns
|
226
|
+
-------
|
227
|
+
Application
|
228
|
+
A new instance of the Orionis application.
|
229
|
+
"""
|
230
|
+
if Application.isRunning():
|
231
|
+
Application.destroy()
|
194
232
|
|
195
|
-
|
196
|
-
# @contextmanager
|
197
|
-
# def app_context():
|
198
|
-
# """
|
199
|
-
# Context manager for creating an instance of the Orionis application.
|
200
|
-
|
201
|
-
# This function initializes the Orionis application with a new container,
|
202
|
-
# ensuring that the application is properly set up before use.
|
203
|
-
|
204
|
-
# Yields
|
205
|
-
# ------
|
206
|
-
# Application
|
207
|
-
# The initialized Orionis application instance.
|
208
|
-
|
209
|
-
# Raises
|
210
|
-
# ------
|
211
|
-
# RuntimeError
|
212
|
-
# If the application has not been properly initialized.
|
213
|
-
# """
|
214
|
-
# try:
|
215
|
-
|
216
|
-
# # Check if the application has been booted
|
217
|
-
# if not Application.booted:
|
218
|
-
# app = Application(Container()).boot()
|
219
|
-
# else:
|
220
|
-
# app = Application.getCurrentInstance()
|
221
|
-
|
222
|
-
# # Yield the application instance
|
223
|
-
# yield app
|
224
|
-
|
225
|
-
# finally:
|
226
|
-
|
227
|
-
# # Close Context Manager
|
228
|
-
# pass
|
229
|
-
|
230
|
-
# def app_booted():
|
231
|
-
# """
|
232
|
-
# Check if the application has been booted.
|
233
|
-
|
234
|
-
# Returns:
|
235
|
-
# bool: True if the application has been booted, False otherwise.
|
236
|
-
# """
|
237
|
-
# return Application.booted
|
238
|
-
|
239
|
-
# def orionis():
|
240
|
-
# """
|
241
|
-
# Creates a new instance of the Orionis application.
|
242
|
-
|
243
|
-
# Ensures that any existing singleton instance of `Application` is removed before
|
244
|
-
# creating a fresh instance. It resets the singleton instances stored in `SingletonMeta`
|
245
|
-
# and `Container`.
|
246
|
-
|
247
|
-
# Returns
|
248
|
-
# -------
|
249
|
-
# Application
|
250
|
-
# A new instance of the Orionis application.
|
251
|
-
# """
|
252
|
-
# Application.reset()
|
253
|
-
|
254
|
-
# return Application()
|
233
|
+
return Application()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
orionis/cli_manager.py,sha256=oXY5UYvtalP996h7z5iaEc7z5b1hyFWXrLPrvtoxWcU,1368
|
3
|
-
orionis/framework.py,sha256=
|
3
|
+
orionis/framework.py,sha256=5G-6LKYFz0VpCjKzsJfB-rR4z78RIvNiXTsOLO16_WE,1387
|
4
4
|
orionis/installer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
orionis/installer/manager.py,sha256=UfUvHOCqcj6YKuwSS6pmhxRXUNGaMWseZNXBZybKLTk,3143
|
6
6
|
orionis/installer/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -12,7 +12,7 @@ orionis/installer/output/output.py,sha256=eA_3yPUc50RwB829IgUzfipkawCIOIRqQlXuUw
|
|
12
12
|
orionis/installer/setup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
orionis/installer/setup/setup.py,sha256=zAZDelFwieZ9HbR_mSgvW9-gI--Zzu__6SZWWw4VEE8,6967
|
14
14
|
orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
|
-
orionis/luminate/application.py,sha256=
|
15
|
+
orionis/luminate/application.py,sha256=eKbqYtJcRzD_1eipvkyCuk-N83m7Ec_Vd63HrMABOUA,7865
|
16
16
|
orionis/luminate/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
17
|
orionis/luminate/config/app.py,sha256=7teuVPuaV2ao0M5Bv-jhSgjEwb9DtVwde2saTRmYru4,1737
|
18
18
|
orionis/luminate/config/auth.py,sha256=CG8F0pfVjKz4DY3d1Wi7gscdhnp4TT-Q8SJ2sdsHh18,523
|
@@ -181,9 +181,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
181
181
|
tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
182
182
|
tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
|
183
183
|
tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
|
184
|
-
orionis-0.
|
185
|
-
orionis-0.
|
186
|
-
orionis-0.
|
187
|
-
orionis-0.
|
188
|
-
orionis-0.
|
189
|
-
orionis-0.
|
184
|
+
orionis-0.155.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
185
|
+
orionis-0.155.0.dist-info/METADATA,sha256=MHkHMOABRHW_3pBQwDiJ1Ex8lHS_IgZm6XxPzQFjk7Q,2970
|
186
|
+
orionis-0.155.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
187
|
+
orionis-0.155.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
|
188
|
+
orionis-0.155.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
189
|
+
orionis-0.155.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|