orionis 0.182.0__py3-none-any.whl → 0.183.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.182.0"
8
+ VERSION = "0.183.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,16 +1,16 @@
1
- import asyncio
2
1
  from typing import Dict, List, Type
3
2
  from orionis.luminate.contracts.application import IApplication
4
3
  from orionis.luminate.contracts.container.container import IContainer
5
4
  from orionis.luminate.contracts.foundation.bootstraper import IBootstrapper
6
- from orionis.luminate.container.container import Container
7
5
  from orionis.luminate.contracts.providers.service_provider import IServiceProvider
6
+ from orionis.luminate.container.container import Container
8
7
  from orionis.luminate.foundation.config.config_bootstrapper import ConfigBootstrapper
9
8
  from orionis.luminate.foundation.console.command_bootstrapper import CommandsBootstrapper
10
9
  from orionis.luminate.foundation.environment.environment_bootstrapper import EnvironmentBootstrapper
11
10
  from orionis.luminate.foundation.exceptions.exception_bootstrapper import BootstrapRuntimeError
12
11
  from orionis.luminate.foundation.providers.service_providers_bootstrapper import ServiceProvidersBootstrapper
13
12
  from orionis.luminate.patterns.singleton import SingletonMeta
13
+ from orionis.luminate.support.asyn_run import AsyncExecutor
14
14
 
15
15
  class Application(metaclass=SingletonMeta):
16
16
  """
@@ -135,13 +135,7 @@ class Application(metaclass=SingletonMeta):
135
135
  self._loadCommands()
136
136
 
137
137
  # Boot service providers
138
- try:
139
- loop = asyncio.get_running_loop()
140
- loop.run_until_complete(self._bootServiceProviders())
141
- except RuntimeError:
142
- loop = asyncio.new_event_loop()
143
- asyncio.set_event_loop(loop)
144
- loop.run_until_complete(self._bootServiceProviders())
138
+ AsyncExecutor.run(self._bootServiceProviders())
145
139
 
146
140
  # Change the application status to booted
147
141
  Application.boot()
@@ -1,13 +1,5 @@
1
1
  from orionis.luminate.contracts.console.command_filter import ICommandFilter
2
2
 
3
- # List of commands to exclude from output formatting
4
- EXCLUDED_COMMANDS = [
5
- 'schedule:work', # Command to handle scheduled work
6
- 'help', # Command to show help information
7
- 'version', # Command to display version information
8
- 'tests:run' # Command to run tests
9
- ]
10
-
11
3
  class CommandFilter(ICommandFilter):
12
4
  """
13
5
  CommandFilter handles the exclusion of specific commands from output formatting.
@@ -37,4 +29,9 @@ class CommandFilter(ICommandFilter):
37
29
  bool
38
30
  Returns True if the command is excluded from output formatting, False otherwise.
39
31
  """
40
- return command in EXCLUDED_COMMANDS
32
+ return command in [
33
+ 'schedule:work', # Command to handle scheduled work
34
+ 'help', # Command to show help information
35
+ 'version', # Command to display version information
36
+ 'tests:run' # Command to run tests
37
+ ]
@@ -1,6 +1,5 @@
1
1
  from orionis.luminate.console.base.command import BaseCommand
2
2
  from orionis.luminate.console.exceptions.cli_exception import CLIOrionisRuntimeError
3
- from orionis.luminate.container.resolve import Resolve
4
3
  from orionis.luminate.contracts.application import IApplication
5
4
 
6
5
  class HelpCommand(BaseCommand):
@@ -9,6 +8,9 @@ class HelpCommand(BaseCommand):
9
8
 
10
9
  This command fetches all registered commands from the cache and presents them in a table format.
11
10
  """
11
+ def __init__(self, app : IApplication):
12
+ # Get the list of commands from the container
13
+ self._commands : dict = app._commands if hasattr(app, '_commands') else {}
12
14
 
13
15
  # Command signature used for execution.
14
16
  signature = "help"
@@ -35,15 +37,9 @@ class HelpCommand(BaseCommand):
35
37
  self.newLine()
36
38
  self.textSuccessBold(" (CLI Interpreter) Available Commands: ")
37
39
 
38
- # Fetch the commands from the Application
39
- app = Resolve(IApplication)
40
-
41
- # Get the list of commands from the container
42
- commands : dict = app._commands if hasattr(app, '_commands') else {}
43
-
44
40
  # Initialize an empty list to store the rows.
45
41
  rows = []
46
- for signature, command_data in commands.items():
42
+ for signature, command_data in self._commands.items():
47
43
  rows.append([signature, command_data['description']])
48
44
 
49
45
  # Sort commands alphabetically
@@ -19,7 +19,7 @@ class ScheduleWorkCommand(BaseCommand):
19
19
  # A brief description of the command.
20
20
  description = "Starts the scheduled tasks."
21
21
 
22
- def __init__(self, schedule:Schedule) -> None:
22
+ def __init__(self, schedule : Schedule) -> None:
23
23
  """
24
24
  Initialize a new instance of the ScheduleWorkCommand class.
25
25
 
@@ -1,8 +1,7 @@
1
- import asyncio
2
1
  from typing import Any, Callable
3
- from orionis.luminate.application import Application
4
2
  from orionis.luminate.container.container import Container
5
3
  from orionis.luminate.container.exception import OrionisContainerValueError
4
+ from orionis.luminate.support.asyn_run import AsyncExecutor
6
5
 
7
6
  class Resolve:
8
7
  """
@@ -63,10 +62,4 @@ class Resolve:
63
62
  )
64
63
 
65
64
  # Resolve and return the service associated with the abstract or alias
66
- try:
67
- loop = asyncio.get_running_loop()
68
- return loop.run_until_complete(container.make(abstract_or_alias))
69
- except RuntimeError:
70
- loop = asyncio.new_event_loop()
71
- asyncio.set_event_loop(loop)
72
- return loop.run_until_complete(container.make(abstract_or_alias))
65
+ AsyncExecutor.run(container.make(abstract_or_alias))
@@ -0,0 +1,21 @@
1
+ import asyncio
2
+
3
+ class AsyncExecutor:
4
+
5
+ @staticmethod
6
+ def run(callback: asyncio.coroutine) -> None:
7
+ """
8
+ Runs a coroutine synchronously.
9
+
10
+ Parameters
11
+ ----------
12
+ callback : asyncio.coroutine
13
+ The coroutine to run.
14
+ """
15
+ try:
16
+ loop = asyncio.get_running_loop()
17
+ loop.run_until_complete(callback)
18
+ except RuntimeError:
19
+ loop = asyncio.new_event_loop()
20
+ asyncio.set_event_loop(loop)
21
+ loop.run_until_complete(callback)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: orionis
3
- Version: 0.182.0
3
+ Version: 0.183.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/console.py,sha256=4gYWxf0fWYgJ4RKwARvnTPh06FL3GJ6SAZ7R2NzOICw,1342
3
- orionis/framework.py,sha256=fKfUuKAjkPm0mQyYql6pNTquY5Ad8ov2roRyybZMlX0,1469
3
+ orionis/framework.py,sha256=0611cXKwFgBp_InJXtHI-KpPr1yPTLckwUHLG2TzZkk,1469
4
4
  orionis/installer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  orionis/installer/manager.py,sha256=SYP-k_3c2oxFOCCWfMz-wnekWivn3VcFVMUU5e_sJYo,2787
6
6
  orionis/installer/output.py,sha256=7O9qa2xtXMB_4ZvVi-Klneom9YazwygAd_4uYAoxhbU,8548
@@ -10,7 +10,7 @@ orionis/installer/contracts/manager.py,sha256=Zfndhuyu0JaTKo3PsGsKmVsvotQMw8Pmt4
10
10
  orionis/installer/contracts/output.py,sha256=t1KLw610-hHy63UbFFE2BYwWHWRbW8_ofuEvRLx_IUE,983
11
11
  orionis/installer/contracts/setup.py,sha256=aWYkCv-z48bXXZynYapc3uMIE1gyO6XnkTw3b4MTBq4,784
12
12
  orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- orionis/luminate/application.py,sha256=WQLs_przTrYrGAkOraAGx8tq_on_pYCBhPezgaNqoHg,7146
13
+ orionis/luminate/application.py,sha256=jQ0fyP54yIs-BqT47gogqmzOHi6mJ4X2-bhCERwU5kc,6936
14
14
  orionis/luminate/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  orionis/luminate/config/app.py,sha256=7teuVPuaV2ao0M5Bv-jhSgjEwb9DtVwde2saTRmYru4,1737
16
16
  orionis/luminate/config/auth.py,sha256=CG8F0pfVjKz4DY3d1Wi7gscdhnp4TT-Q8SJ2sdsHh18,523
@@ -23,15 +23,15 @@ orionis/luminate/config/mail.py,sha256=3iYXG72bXiVns4sEPZ_A3-cGcFjGEGDXkuLKkk-hK
23
23
  orionis/luminate/config/queue.py,sha256=DYjP5zD09ISsIX117wtOfjiG_iQrcrPoQVeeftmuO3c,1739
24
24
  orionis/luminate/config/session.py,sha256=7mOC_DfGIBDqAClSiewHoTA9Kht_zdHApvALcZc7cfY,1861
25
25
  orionis/luminate/console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- orionis/luminate/console/command_filter.py,sha256=y_S--nZ1FynurqWcXP-yCl3YE_LNAtXi6Ae57gdDdAU,1329
26
+ orionis/luminate/console/command_filter.py,sha256=fmqjQZFwhsEMKWuTtt4dIQF-souVSJk1ksO3UqV7sis,1274
27
27
  orionis/luminate/console/kernel.py,sha256=knzOpbsHJJpAbCSrnFXgRHK9Uk4OisEW_jiylaR-PLA,891
28
28
  orionis/luminate/console/parser.py,sha256=jQPDYHvGt-h2qnmDUObaxF9CmuX9YK_8XTYnQwKCSXE,5586
29
29
  orionis/luminate/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  orionis/luminate/console/base/command.py,sha256=K-Jv3OTVenyrpTI2Jov-WQ435CA4tgqMy6sztxYKDFA,12674
31
31
  orionis/luminate/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  orionis/luminate/console/commands/cache_clear.py,sha256=UV2VFFK-LsUNDrqKb_Q8HWnwlwvIuTWTsbQ5x5rWHGk,2859
33
- orionis/luminate/console/commands/help.py,sha256=Op8YJ-fV-NUljN8OETS-1yiNAJ_svEIDl_LbCtFlSCc,2331
34
- orionis/luminate/console/commands/schedule_work.py,sha256=_MY_dsPQtH--YaEg6S9yhUaGHE76kVFESu2eeMu5pZw,2172
33
+ orionis/luminate/console/commands/help.py,sha256=3Sc_nXCA9RFiFvvVUkUjVu3CSLit1JSflt2akP7xtN4,2224
34
+ orionis/luminate/console/commands/schedule_work.py,sha256=eYF94qgNjjAGLoN4JWA0e0zeNWc3fptj2NY2O7KGGGU,2174
35
35
  orionis/luminate/console/commands/tests.py,sha256=Z7e6aM5Vu8C7R8iC8sJgUYVN9aJgtVMkqjUEFxPq91o,1281
36
36
  orionis/luminate/console/commands/version.py,sha256=llVPK6ELtf8dIdPvLbybrtipWwZkzV0EXc9ShL-C-GY,1140
37
37
  orionis/luminate/console/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -46,7 +46,7 @@ orionis/luminate/container/container.py,sha256=9xdODX1h4YK6V-THrfgm5XN95imobExzr
46
46
  orionis/luminate/container/container_integrity.py,sha256=lFQ41IN_3Z0SbtJzZ_9jewoaUI4xlsBEFXPfn-p82uI,7976
47
47
  orionis/luminate/container/exception.py,sha256=ap1SqYEjQEEHXJJTNmL7V1jrmRjgT5_7geZ95MYkhMA,1691
48
48
  orionis/luminate/container/lifetimes.py,sha256=2lbdiV7R2WlJf1cLD6eBxLnJud_lZvX1IhQH2Djy3Ww,375
49
- orionis/luminate/container/resolve.py,sha256=z2YyYSqahDz73C5iTNOIsqaFAfi-SKJdFmHpfENVSA8,2582
49
+ orionis/luminate/container/resolve.py,sha256=PbeHc14fJSnn1z5B6aD-MBDkTyje9E2dKVPRw0TYW-Y,2299
50
50
  orionis/luminate/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  orionis/luminate/contracts/application.py,sha256=FIR6WMY0y-Hkjp0jWfjJV9kwIqBb-RB1-Jl0GWCk9eI,1077
52
52
  orionis/luminate/contracts/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -159,6 +159,7 @@ orionis/luminate/services/files/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
159
159
  orionis/luminate/services/files/path_resolver_service.py,sha256=gCGVLtdXGuEIE6I8tm6JEB84HS1Fa5rk2whO2R6u8Wc,1698
160
160
  orionis/luminate/services/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
161
161
  orionis/luminate/services/log/log_service.py,sha256=7KZ9i5RGquUqRADTa7T61v4kTu_qjDOVyaoGvm_51f0,8291
162
+ orionis/luminate/support/asyn_run.py,sha256=Se2A0UvuOuS_zo7V1AycEjRKpfV6m-1pN9h7Xi2MHMQ,564
162
163
  orionis/luminate/support/dot_dict.py,sha256=FVHfBuAGTTVMjNG01Fix645fRNKKUMmNx61pYkxPL5c,1253
163
164
  orionis/luminate/support/exception_to_dict.py,sha256=OV3vWZ6Dlh3EnFurR_7zhR3mfXDZg-UFbMsfs4tNnLA,2105
164
165
  orionis/luminate/support/reflection.py,sha256=TbWZ_cer0PXrPlwCYFbUJRymlzYxXT0E4C5XCsSc3mw,11951
@@ -179,9 +180,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
179
180
  tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
180
181
  tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
181
182
  tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
182
- orionis-0.182.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
183
- orionis-0.182.0.dist-info/METADATA,sha256=xFxVAcPv27s1VDFhIk-9DYVbG2ti3YjKoZMc_N0zKio,3003
184
- orionis-0.182.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
185
- orionis-0.182.0.dist-info/entry_points.txt,sha256=a_e0faeSqyUCVZd0MqljQ2oaHHdlsz6g9sU_bMqi5zQ,49
186
- orionis-0.182.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
187
- orionis-0.182.0.dist-info/RECORD,,
183
+ orionis-0.183.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
184
+ orionis-0.183.0.dist-info/METADATA,sha256=nvk7FryxtICA1oS71ijwfRCYd1Igcjdkxy1BiQhOetI,3003
185
+ orionis-0.183.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
186
+ orionis-0.183.0.dist-info/entry_points.txt,sha256=a_e0faeSqyUCVZd0MqljQ2oaHHdlsz6g9sU_bMqi5zQ,49
187
+ orionis-0.183.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
188
+ orionis-0.183.0.dist-info/RECORD,,