orionis 0.137.0__py3-none-any.whl → 0.139.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 +31 -5
- orionis/luminate/container/container.py +8 -0
- {orionis-0.137.0.dist-info → orionis-0.139.0.dist-info}/METADATA +1 -1
- {orionis-0.137.0.dist-info → orionis-0.139.0.dist-info}/RECORD +9 -9
- {orionis-0.137.0.dist-info → orionis-0.139.0.dist-info}/LICENCE +0 -0
- {orionis-0.137.0.dist-info → orionis-0.139.0.dist-info}/WHEEL +0 -0
- {orionis-0.137.0.dist-info → orionis-0.139.0.dist-info}/entry_points.txt +0 -0
- {orionis-0.137.0.dist-info → orionis-0.139.0.dist-info}/top_level.txt +0 -0
orionis/framework.py
CHANGED
orionis/luminate/application.py
CHANGED
@@ -65,6 +65,17 @@ class Application(metaclass=SingletonMeta):
|
|
65
65
|
raise RuntimeError("Application has not been initialized yet. Please create an instance first.")
|
66
66
|
return SingletonMeta._instances[cls]
|
67
67
|
|
68
|
+
@classmethod
|
69
|
+
def reset(cls):
|
70
|
+
"""
|
71
|
+
Resets the application instance if it exists.
|
72
|
+
|
73
|
+
This method is used to reset the application instance and clear the singleton instances
|
74
|
+
stored in the `SingletonMeta` class.
|
75
|
+
"""
|
76
|
+
if cls in SingletonMeta._instances:
|
77
|
+
del SingletonMeta._instances[cls]
|
78
|
+
|
68
79
|
def __init__(self, container: Container):
|
69
80
|
"""
|
70
81
|
Initializes the Application instance.
|
@@ -353,11 +364,8 @@ def app_context():
|
|
353
364
|
|
354
365
|
# Check if the application has been booted
|
355
366
|
if not Application.booted:
|
356
|
-
|
357
|
-
app = Application(Container())
|
358
|
-
app.boot()
|
367
|
+
app = Application(Container()).boot()
|
359
368
|
else:
|
360
|
-
# Get the current application instance
|
361
369
|
app = Application.getCurrentInstance()
|
362
370
|
|
363
371
|
# Yield the application instance
|
@@ -375,4 +383,22 @@ def app_booted():
|
|
375
383
|
Returns:
|
376
384
|
bool: True if the application has been booted, False otherwise.
|
377
385
|
"""
|
378
|
-
return Application.booted
|
386
|
+
return Application.booted
|
387
|
+
|
388
|
+
def orionis():
|
389
|
+
"""
|
390
|
+
Creates a new instance of the Orionis application.
|
391
|
+
|
392
|
+
Ensures that any existing singleton instance of `Application` is removed before
|
393
|
+
creating a fresh instance. It resets the singleton instances stored in `SingletonMeta`
|
394
|
+
and `Container`.
|
395
|
+
|
396
|
+
Returns
|
397
|
+
-------
|
398
|
+
Application
|
399
|
+
A new instance of the Orionis application.
|
400
|
+
"""
|
401
|
+
Container.reset()
|
402
|
+
Application.reset()
|
403
|
+
|
404
|
+
return Application(Container())
|
@@ -23,6 +23,14 @@ class Container(IContainer):
|
|
23
23
|
_instance = None
|
24
24
|
_lock = Lock()
|
25
25
|
|
26
|
+
@classmethod
|
27
|
+
def reset(cls):
|
28
|
+
"""
|
29
|
+
Reset the container instance to None, allowing a new instance to be created.
|
30
|
+
"""
|
31
|
+
cls._instance = None
|
32
|
+
super().__new__(cls)
|
33
|
+
|
26
34
|
def __new__(cls):
|
27
35
|
if cls._instance is None:
|
28
36
|
with cls._lock:
|
@@ -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=8pAzBJ1IiXqLxGDFQGzGI7wssFrEhVIxXtYksP4SJfs,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=BFxydlIxmVRh1-FE5mCHmkEAbC0n01k2Xy81pmNlvHo,14596
|
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
|
@@ -43,7 +43,7 @@ orionis/luminate/console/output/console.py,sha256=_O2einYXUzgsy1w18aprUmUkBqg4rA
|
|
43
43
|
orionis/luminate/console/output/executor.py,sha256=Momq8rSbS-p7xUtnJM6CsK4hAyP515jCdN5q77MxLGA,3371
|
44
44
|
orionis/luminate/console/output/progress_bar.py,sha256=IUD3Wqi9dplbrSkeD8v48zBdFA92S4viTKGkoIIXqFw,3098
|
45
45
|
orionis/luminate/console/output/styles.py,sha256=2e1_FJdNpKaVqmdlCx-udzTleH_6uEFE9_TjH7T1ZUk,3696
|
46
|
-
orionis/luminate/container/container.py,sha256=
|
46
|
+
orionis/luminate/container/container.py,sha256=7NVx1ELsI0Znnxrmhap8kEMYHLoGJ2qC4deEl0AvpXc,17228
|
47
47
|
orionis/luminate/container/exception.py,sha256=ap1SqYEjQEEHXJJTNmL7V1jrmRjgT5_7geZ95MYkhMA,1691
|
48
48
|
orionis/luminate/container/types.py,sha256=DLComn-gO_5KIm3WpRrkCOOHJ8gvFcvCJLRSeNGiBok,1744
|
49
49
|
orionis/luminate/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -176,9 +176,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
176
176
|
tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
177
177
|
tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
|
178
178
|
tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
|
179
|
-
orionis-0.
|
180
|
-
orionis-0.
|
181
|
-
orionis-0.
|
182
|
-
orionis-0.
|
183
|
-
orionis-0.
|
184
|
-
orionis-0.
|
179
|
+
orionis-0.139.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
180
|
+
orionis-0.139.0.dist-info/METADATA,sha256=WNijsWFpa2l4Zfj3W-tiJGmCATrOiKaRiUhSxB4W5mo,2970
|
181
|
+
orionis-0.139.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
182
|
+
orionis-0.139.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
|
183
|
+
orionis-0.139.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
184
|
+
orionis-0.139.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|