orionis 0.385.0__py3-none-any.whl → 0.387.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.
@@ -1,6 +1,7 @@
1
1
  from typing import Type, List
2
2
  from orionis.container.container import Container
3
3
  from orionis.container.contracts.service_provider import IServiceProvider
4
+ from orionis.foundation.config.roots.paths import Paths
4
5
  from orionis.foundation.contracts.application import IApplication
5
6
 
6
7
  class Application(Container, IApplication):
@@ -18,7 +19,9 @@ class Application(Container, IApplication):
18
19
  Flag indicating whether providers have been booted
19
20
  """
20
21
  @property
21
- def isBooted(self) -> bool:
22
+ def isBooted(
23
+ self
24
+ ) -> bool:
22
25
  """
23
26
  Check if the application providers have been booted.
24
27
 
@@ -29,7 +32,23 @@ class Application(Container, IApplication):
29
32
  """
30
33
  return self.__booted
31
34
 
32
- def __init__(self) -> None:
35
+ @property
36
+ def path(
37
+ self,
38
+ name: str = None
39
+ ) -> Paths:
40
+
41
+ if name is None:
42
+ return self.__paths
43
+
44
+ if hasattr(self.__paths, name):
45
+ return getattr(self.__paths, name)
46
+
47
+ raise AttributeError(f"Path '{name}' not found in application paths")
48
+
49
+ def __init__(
50
+ self
51
+ ) -> None:
33
52
  """
34
53
  Initialize a new App instance.
35
54
 
@@ -48,13 +67,18 @@ class Application(Container, IApplication):
48
67
  self.__providers: List[IServiceProvider] = []
49
68
  self.__booted: bool = False
50
69
 
70
+ # List of paths for the application
71
+ self.__paths: Paths = None
72
+
51
73
  # Mark this instance as initialized
52
74
  self.__initialized = True
53
75
 
54
76
  # Bootstrap core services
55
77
  self.__bootFramework()
56
78
 
57
- def __bootFramework(self) -> None:
79
+ def __bootFramework(
80
+ self
81
+ ) -> None:
58
82
  """
59
83
  Bootstrap the application by loading internal framework providers.
60
84
 
@@ -66,7 +90,9 @@ class Application(Container, IApplication):
66
90
  self.__loadFrameworkProviders()
67
91
  self.__loadFrameworksKernel()
68
92
 
69
- def __loadFrameworkProviders(self) -> None:
93
+ def __loadFrameworkProviders(
94
+ self
95
+ ) -> None:
70
96
  """
71
97
  Load internal framework service providers.
72
98
 
@@ -94,7 +120,9 @@ class Application(Container, IApplication):
94
120
  for provider_cls in core_providers:
95
121
  self.__registerProvider(provider_cls)
96
122
 
97
- def __loadFrameworksKernel(self) -> None:
123
+ def __loadFrameworksKernel(
124
+ self
125
+ ) -> None:
98
126
  """
99
127
  Load the core framework kernel.
100
128
 
@@ -144,7 +172,9 @@ class Application(Container, IApplication):
144
172
  self.__providers.append(provider)
145
173
  return provider
146
174
 
147
- def __bootProviders(self) -> None:
175
+ def __bootProviders(
176
+ self
177
+ ) -> None:
148
178
  """
149
179
  Boot all registered service providers.
150
180
 
@@ -166,7 +196,10 @@ class Application(Container, IApplication):
166
196
 
167
197
  self.__booted = True
168
198
 
169
- def load(self, providers: List[Type[IServiceProvider]] = []) -> None:
199
+ def load(
200
+ self,
201
+ providers: List[Type[IServiceProvider]] = []
202
+ ) -> None:
170
203
  """
171
204
  Load and boot a list of service providers.
172
205
 
@@ -189,15 +222,55 @@ class Application(Container, IApplication):
189
222
  # Boot all registered providers
190
223
  self.__bootProviders()
191
224
 
192
- def getProviders(self) -> List[IServiceProvider]:
225
+ def paths(
226
+ self,
227
+ paths: dict|Paths = None,
228
+ **kwargs
229
+ ) -> Paths:
193
230
  """
194
- Get the list of registered providers.
231
+ Configure or retrieve the application paths.
232
+
233
+ This method configures the application's path settings using
234
+ the provided parameters or returns the current paths if no
235
+ parameters are provided.
236
+
237
+ Parameters
238
+ ----------
239
+ paths : dict or Paths, optional
240
+ Dictionary of paths or a Paths instance to use as the
241
+ application's path configuration
242
+ **kwargs
243
+ Key-value pairs to create a Paths instance if a dict
244
+ or Paths object is not provided
195
245
 
196
246
  Returns
197
247
  -------
198
- List[IServiceProvider]
199
- The list of registered service providers
200
- """
248
+ Paths
249
+ The current application Paths instance
201
250
 
202
- # Return a copy to prevent external modification
203
- return self.__providers.copy()
251
+ Raises
252
+ ------
253
+ ValueError
254
+ If the provided parameters cannot be used to create a valid Paths instance
255
+ """
256
+ # Return existing paths if no arguments provided
257
+ if paths is None and not kwargs:
258
+ if self.__paths is None:
259
+ self.__paths = Paths()
260
+ return self.__paths
261
+
262
+ # Configure paths based on input type
263
+ try:
264
+ if isinstance(paths, Paths):
265
+ self.__paths = paths
266
+ elif isinstance(paths, dict):
267
+ self.__paths = Paths(**paths)
268
+ elif kwargs:
269
+ self.__paths = Paths(**kwargs)
270
+ else:
271
+ raise ValueError("Invalid paths configuration: must provide a Paths object, dictionary, or keyword arguments")
272
+ except Exception as e:
273
+ raise ValueError(f"Failed to configure application paths: {str(e)}")
274
+
275
+ # Return the configured paths
276
+ return self.__paths
@@ -43,16 +43,4 @@ class IApplication(IContainer):
43
43
  -------
44
44
  None
45
45
  """
46
- pass
47
-
48
- @abstractmethod
49
- def getProviders(self) -> List[IServiceProvider]:
50
- """
51
- Get the list of registered providers.
52
-
53
- Returns
54
- -------
55
- List[IServiceProvider]
56
- The list of registered service providers
57
- """
58
- pass
46
+ pass
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.385.0"
8
+ VERSION = "0.387.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
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.385.0
3
+ Version: 0.387.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
@@ -146,7 +146,7 @@ orionis/container/validators/is_subclass.py,sha256=4sBaGLoRs8nUhuWjlP0VJqyTwVHYq
146
146
  orionis/container/validators/is_valid_alias.py,sha256=4uAYcq8xov7jZbXnpKpjNkxcZtlTNnL5RRctVPMwJes,1424
147
147
  orionis/container/validators/lifetime.py,sha256=IQ43fDNrxYHMlZH2zlYDJnlkLO_eS4U7Fs3UJgQBidI,1844
148
148
  orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
- orionis/foundation/application.py,sha256=XpVoQZpH3wx66LnYsnTOsVlQhgBxtZe9qunKZQ6AYxU,6582
149
+ orionis/foundation/application.py,sha256=W10L3pRPq9LdQZivp5yMEUqfP5lHoLbwOdUhoxufST0,8598
150
150
  orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
151
151
  orionis/foundation/config/startup.py,sha256=zutF-34DkW68bpiTxH9xrmIe1iJdXCF9Y6wueXS6qys,8265
152
152
  orionis/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -235,7 +235,7 @@ orionis/foundation/config/testing/entities/testing.py,sha256=keU7dSuRv0rgaG-T4Vo
235
235
  orionis/foundation/config/testing/enums/__init__.py,sha256=tCHed6wBzqHx8o3kWBGm8tZYkYOKdSAx8TvgC-Eauv0,75
236
236
  orionis/foundation/config/testing/enums/test_mode.py,sha256=IbFpauu7J-iSAfmC8jDbmTEYl8eZr-AexL-lyOh8_74,337
237
237
  orionis/foundation/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
238
- orionis/foundation/contracts/application.py,sha256=vgvUnzQAQlpzkfOBDR-H4Y7mL9cPZuy5QduFayx__FQ,1693
238
+ orionis/foundation/contracts/application.py,sha256=pfAngQvnnVjVZH2GhH2Bt8-540EOxWybVQa7dyeHGtg,1404
239
239
  orionis/foundation/contracts/config.py,sha256=Rpz6U6t8OXHO9JJKSTnCimytXE-tfCB-1ithP2nG8MQ,628
240
240
  orionis/foundation/exceptions/__init__.py,sha256=XtG3MJ_MFNY_dU5mmTyz_N_4QG1jYrcv5RegBso7wuY,163
241
241
  orionis/foundation/exceptions/integrity.py,sha256=mc4pL1UMoYRHEmphnpW2oGk5URhu7DJRREyzHaV-cs8,472
@@ -247,7 +247,7 @@ orionis/foundation/providers/path_resolver_provider.py,sha256=rXvaVc5sSqmDgRzWJo
247
247
  orionis/foundation/providers/progress_bar_provider.py,sha256=75Jr4iEgUOUGl8Di1DioeP5_HRQlR-1lVzPmS96sWjA,737
248
248
  orionis/foundation/providers/workers_provider.py,sha256=WWlji3C69_-Y0c42aZDbR_bmcE_qZEh2SaA_cNkCivI,702
249
249
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
250
- orionis/metadata/framework.py,sha256=yPevn6fPgNAn7N2vN-FlVyYTvJZ-_piFlZ8RB_V5pDo,4960
250
+ orionis/metadata/framework.py,sha256=Ys8KlTlyfn6hzoQmowhfU99fcmWzW5OzLjQ3Zw-edH4,4960
251
251
  orionis/metadata/package.py,sha256=tqLfBRo-w1j_GN4xvzUNFyweWYFS-qhSgAEc-AmCH1M,5452
252
252
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
253
253
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -384,7 +384,7 @@ orionis/test/records/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
384
384
  orionis/test/records/logs.py,sha256=EOQcloMVdhlNl2lU9igQz8H4b-OtKtiwh2pgr_QZWOI,13186
385
385
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
386
386
  orionis/test/view/render.py,sha256=zd7xDvVfmQ2HxZamDTzL2-z2PpyL99EaolbbM7wTah4,5014
387
- orionis-0.385.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
387
+ orionis-0.387.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
388
388
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
389
389
  tests/example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
390
390
  tests/example/test_example.py,sha256=8G7kp74PZZ0Tdnw8WkheZ7lvZVFpdx_9ShOZBN9GEF0,25582
@@ -485,8 +485,8 @@ tests/support/wrapper/test_services_wrapper_docdict.py,sha256=nTNrvJkMSPx_aopEQ9
485
485
  tests/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
486
486
  tests/testing/test_testing_result.py,sha256=fnH7hjumNSErAFGITJgq2LHxSzvPF2tdtmHL9kyAv-Y,4409
487
487
  tests/testing/test_testing_unit.py,sha256=d3CRGo6608fMzYcZKIKapjx_af2aigqWiKSiuK9euIY,7600
488
- orionis-0.385.0.dist-info/METADATA,sha256=nphEHmIaOM7ba4ts0gUfRjzTQZr4B0Id_TV_2oN2FH8,4772
489
- orionis-0.385.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
490
- orionis-0.385.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
491
- orionis-0.385.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
492
- orionis-0.385.0.dist-info/RECORD,,
488
+ orionis-0.387.0.dist-info/METADATA,sha256=BdLSEqBShjExKvO-If1wERXlfPa2U2C9EhHFyVCHBWM,4772
489
+ orionis-0.387.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
490
+ orionis-0.387.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
491
+ orionis-0.387.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
492
+ orionis-0.387.0.dist-info/RECORD,,