orionis 0.112.0__py3-none-any.whl → 0.113.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.112.0"
8
+ VERSION = "0.113.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
  from typing import Any, Callable
2
+ from contextlib import contextmanager
2
3
  from orionis.contracts.foundation.i_bootstraper import IBootstrapper
3
- from orionis.luminate.console.output.console import Console
4
4
  from orionis.luminate.container.container import Container
5
5
  from orionis.luminate.foundation.config.config_bootstrapper import ConfigBootstrapper
6
6
  from orionis.luminate.foundation.console.command_bootstrapper import CommandsBootstrapper
@@ -328,4 +328,60 @@ class Application(metaclass=SingletonMeta):
328
328
  for service in self._after_boot_service_providers:
329
329
  _environment_provider : ServiceProvider = service(app=self.container)
330
330
  _environment_provider.register()
331
- _environment_provider.boot()
331
+ _environment_provider.boot()
332
+
333
+ @contextmanager
334
+ def app_context():
335
+ """
336
+ Context manager for creating an instance of the Orionis application.
337
+
338
+ This function initializes the Orionis application with a new container,
339
+ ensuring that the application is properly set up before use.
340
+
341
+ Yields
342
+ ------
343
+ Application
344
+ The initialized Orionis application instance.
345
+
346
+ Raises
347
+ ------
348
+ RuntimeError
349
+ If the application has not been properly initialized.
350
+ """
351
+ try:
352
+
353
+ # Check if the application has been booted
354
+ if not Application.booted:
355
+ # Create a new application instance
356
+ app = Application(Container())
357
+ app.boot()
358
+ else:
359
+ # Get the current application instance
360
+ app = Application.getCurrentInstance()
361
+
362
+ # Yield the application instance
363
+ yield app
364
+
365
+ finally:
366
+
367
+ # Close Context Manager
368
+ pass
369
+
370
+ def app_booted():
371
+ """
372
+ Context manager for creating an instance of the Orionis application.
373
+
374
+ This function initializes the Orionis application with a new container,
375
+ ensuring that the application is properly set up before use.
376
+
377
+ Yields
378
+ ------
379
+ Application
380
+ The initialized Orionis application instance.
381
+
382
+ Raises
383
+ ------
384
+ RuntimeError
385
+ If the application has not been properly initialized.
386
+ """
387
+ return Application.booted
@@ -1,4 +1,4 @@
1
- from orionis.luminate.app_context import app_context
1
+ from orionis.luminate.application import app_context
2
2
  from orionis.luminate.console.base.command import BaseCommand
3
3
  from orionis.luminate.console.exceptions.cli_exception import CLIOrionisRuntimeError
4
4
 
@@ -1,5 +1,5 @@
1
1
  from typing import Any
2
- from orionis.luminate.app_context import app_booted
2
+ from orionis.luminate.application import app_booted
3
3
  from orionis.luminate.console.output.console import Console
4
4
  from orionis.luminate.container.container import Container
5
5
  from orionis.luminate.container.exception import OrionisContainerException, OrionisContainerTypeError
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: orionis
3
- Version: 0.112.0
3
+ Version: 0.113.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=D-irTHNRjw1hfyrT7bSHJiOHHtllt5ZYIfV6Pv81ULk,1387
3
+ orionis/framework.py,sha256=iSTU5g6xH5z5JccKETU1PC7iCtwePfLLf_HXHLM5zPU,1387
4
4
  orionis/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  orionis/contracts/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  orionis/contracts/config/i_config.py,sha256=rbeojO2gm8XhSXIPY8EnUt4e0wO633OKF9Nx_tN5y60,785
@@ -67,8 +67,7 @@ orionis/installer/installer_manager.py,sha256=Hb6T0bmSl39T30maY-nUWkrLhG77JdrKe4
67
67
  orionis/installer/installer_output.py,sha256=LeKxzuXpnHOKbKpUtx3tMGkCi2bGcPV1VNnfBxwfxUU,7161
68
68
  orionis/installer/installer_setup.py,sha256=c2HtVklSa-2_-YVonc7fwtoK-RTDqBS2Ybvbekgfqtc,6970
69
69
  orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
- orionis/luminate/app.py,sha256=u_QkD3v0wr2ok6QmgyiAMLIDFA72imwI86DBijpM7eo,12705
71
- orionis/luminate/app_context.py,sha256=0njAnGRjlpCqizGv2_FHs-SHdzeWR0mbUUx7NI_BS18,1584
70
+ orionis/luminate/application.py,sha256=C2zBPly4MQYdzb8f7Y1oZTY9iEgGvWiM7UqG37yNimI,14122
72
71
  orionis/luminate/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
72
  orionis/luminate/config/app.py,sha256=7teuVPuaV2ao0M5Bv-jhSgjEwb9DtVwde2saTRmYru4,1737
74
73
  orionis/luminate/config/auth.py,sha256=CG8F0pfVjKz4DY3d1Wi7gscdhnp4TT-Q8SJ2sdsHh18,523
@@ -88,7 +87,7 @@ orionis/luminate/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
88
87
  orionis/luminate/console/base/command.py,sha256=YGHd5xVYILcNhQumi74IRnzvagvjufEO2Bx1CwHRToY,12544
89
88
  orionis/luminate/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
90
89
  orionis/luminate/console/commands/cache_clear.py,sha256=KyXVSwtLaV1O1cTEkNzX9czCwEoeQlAjiT0jUFMO8iE,2684
91
- orionis/luminate/console/commands/help.py,sha256=8_LOTuiZvA8HToKP5qBoN7rWlEo3T0Qik7-f3fyrTgo,2288
90
+ orionis/luminate/console/commands/help.py,sha256=kbE4WiTE1ypGKZl5lGnz_HxRA5moKxOSYvo92IjiuCQ,2288
92
91
  orionis/luminate/console/commands/schedule_work.py,sha256=xbutdJMYL0fIZtABiS_XalNzvRhYvR2tmu8shNiDEW4,2165
93
92
  orionis/luminate/console/commands/tests.py,sha256=Z7e6aM5Vu8C7R8iC8sJgUYVN9aJgtVMkqjUEFxPq91o,1281
94
93
  orionis/luminate/console/commands/version.py,sha256=llVPK6ELtf8dIdPvLbybrtipWwZkzV0EXc9ShL-C-GY,1140
@@ -103,7 +102,7 @@ orionis/luminate/container/container.py,sha256=kg1zrvlMrzYCrORbDZ12JVZJ_z81gLDUp
103
102
  orionis/luminate/container/exception.py,sha256=ap1SqYEjQEEHXJJTNmL7V1jrmRjgT5_7geZ95MYkhMA,1691
104
103
  orionis/luminate/container/types.py,sha256=BDcXN0__voRNHZ5Gr5dF0sWIYAQyNk4TxAwILBWyDAA,1735
105
104
  orionis/luminate/facades/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
106
- orionis/luminate/facades/app.py,sha256=oBL9ybLUBK41JS6fenEf8iPyKQebnVFvVe4bGACOYu4,1607
105
+ orionis/luminate/facades/app.py,sha256=8s0CLzGXcfgwXpJDsgde4Zw7CJd7cuwQzPyaSh20iGI,1607
107
106
  orionis/luminate/facades/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
107
  orionis/luminate/facades/commands/commands_facade.py,sha256=xy-5sW5_fDXhS2y0c0CCbBOfrOR0mJQLVTwBe3J8WTk,1561
109
108
  orionis/luminate/facades/commands/scheduler_facade.py,sha256=X1Ox0NVOA9RyiKmw3UYgiF68jdIWU8HNyOf7uD0SZ54,1432
@@ -175,9 +174,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
175
174
  tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
176
175
  tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
177
176
  tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
178
- orionis-0.112.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
179
- orionis-0.112.0.dist-info/METADATA,sha256=_6ekbP2eCdpr6um2wC2v4ZUGubqsyoPfGR6hxbJxGOI,2979
180
- orionis-0.112.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
181
- orionis-0.112.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
182
- orionis-0.112.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
183
- orionis-0.112.0.dist-info/RECORD,,
177
+ orionis-0.113.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
178
+ orionis-0.113.0.dist-info/METADATA,sha256=T1C21-uTpYqyGstkpJkpfVOqifHmlcEGr47yBfmqdGk,2979
179
+ orionis-0.113.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
180
+ orionis-0.113.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
181
+ orionis-0.113.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
182
+ orionis-0.113.0.dist-info/RECORD,,
@@ -1,60 +0,0 @@
1
- from contextlib import contextmanager
2
- from orionis.luminate.app import Application
3
- from orionis.luminate.container.container import Container
4
-
5
- @contextmanager
6
- def app_context():
7
- """
8
- Context manager for creating an instance of the Orionis application.
9
-
10
- This function initializes the Orionis application with a new container,
11
- ensuring that the application is properly set up before use.
12
-
13
- Yields
14
- ------
15
- Application
16
- The initialized Orionis application instance.
17
-
18
- Raises
19
- ------
20
- RuntimeError
21
- If the application has not been properly initialized.
22
- """
23
- try:
24
-
25
- # Check if the application has been booted
26
- if not Application.booted:
27
- # Create a new application instance
28
- app = Application(Container())
29
- app.boot()
30
- else:
31
- # Get the current application instance
32
- app = Application.getCurrentInstance()
33
-
34
- # Yield the application instance
35
- yield app
36
-
37
- finally:
38
-
39
- # Close Context Manager
40
- pass
41
-
42
-
43
- def app_booted():
44
- """
45
- Context manager for creating an instance of the Orionis application.
46
-
47
- This function initializes the Orionis application with a new container,
48
- ensuring that the application is properly set up before use.
49
-
50
- Yields
51
- ------
52
- Application
53
- The initialized Orionis application instance.
54
-
55
- Raises
56
- ------
57
- RuntimeError
58
- If the application has not been properly initialized.
59
- """
60
- return Application.booted