orionis 0.309.0__py3-none-any.whl → 0.310.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.
@@ -17,6 +17,6 @@ class Container:
17
17
  The concrete implementation to associate with the abstract type.
18
18
  """
19
19
 
20
- print(ReflectionAbstract.type(abstract))
20
+ ReflectionAbstract.ensureIsAbstractClass(abstract)
21
21
 
22
22
  # self.bind(abstract, concrete, Lifetime.TRANSIENT)
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.309.0"
8
+ VERSION = "0.310.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -12,44 +12,39 @@ from orionis.services.introspection.exceptions.reflection_value_error import Ref
12
12
  class ReflectionAbstract(IReflectionAbstract):
13
13
 
14
14
  @staticmethod
15
- def type(abstract: Type):
16
-
17
- # Check if the provided abstract is a class type
18
- if not isinstance(abstract, type):
19
- raise ReflectionTypeError(f"Expected a class type for 'abstract', got {type(abstract).__name__!r}")
20
-
21
- # Check if it's an abstract base class (interface)
22
- if not bool(getattr(abstract, '__abstractmethods__', False)):
23
- raise ReflectionTypeError(f"Provided class '{abstract.__name__}' is not an interface (abstract base class)")
24
-
25
- # Return if is abstract class.
26
- return type(abstract)
27
-
28
- def __init__(self, abstract: Type) -> None:
15
+ def ensureIsAbstractClass(abstract: Type):
29
16
  """
30
- Initializes the reflection class with the provided abstract base class (interface).
17
+ Ensures that the provided object is an abstract base class (interface).
31
18
 
32
19
  Parameters
33
20
  ----------
34
21
  abstract : Type
35
- The abstract base class (interface) to be reflected upon.
22
+ The class to check.
36
23
 
37
24
  Raises
38
25
  ------
39
26
  ReflectionTypeError
40
- If 'abstract' is not a class type.
41
- ReflectionTypeError
42
- If 'abstract' is not an abstract base class (interface).
27
+ If 'abstract' is not a class type or not an abstract base class.
43
28
  """
44
-
45
- # Check if the provided abstract is a class type
46
29
  if not isinstance(abstract, type):
47
30
  raise ReflectionTypeError(f"Expected a class type for 'abstract', got {type(abstract).__name__!r}")
48
-
49
- # Check if it's an abstract base class (interface)
50
31
  if not bool(getattr(abstract, '__abstractmethods__', False)):
51
32
  raise ReflectionTypeError(f"Provided class '{abstract.__name__}' is not an interface (abstract base class)")
33
+ return True
34
+
35
+ def __init__(self, abstract: Type) -> None:
36
+ """
37
+ Initializes the ReflectionAbstract instance with the given abstract class.
38
+ Args:
39
+ abstract (Type): The abstract base class (interface) to be reflected.
40
+ Raises:
41
+ TypeError: If the provided abstract is not an abstract base class.
42
+ """
43
+
44
+ # Ensure the provided abstract is an abstract base class (interface)
45
+ ReflectionAbstract.ensureIsAbstractClass(abstract)
52
46
 
47
+ # Set the abstract class as a private attribute
53
48
  self.__abstract = abstract
54
49
 
55
50
  def getClass(self) -> Type:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.309.0
3
+ Version: 0.310.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
@@ -135,7 +135,7 @@ orionis/console/output/console.py,sha256=TE_Hl720ADd82dbERFSWhkoQRukDQZmETSw4nkw
135
135
  orionis/console/output/executor.py,sha256=bdvkzW2-buy0BPpy2r5qUGrRFW2Ay6k-5rSeHb0gQ3o,3352
136
136
  orionis/console/output/progress_bar.py,sha256=vFy582z6VJS46LV6tuyrmr9qvdVeTEtw3hyNcEHezeg,3088
137
137
  orionis/console/output/styles.py,sha256=6a4oQCOBOKMh2ARdeq5GlIskJ3wjiylYmh66tUKKmpQ,4053
138
- orionis/container/container.py,sha256=z6xer80JwWZvDtb4m3mm3PT5k0gTcYY_95J0gVHvGcw,751
138
+ orionis/container/container.py,sha256=gFWufyr7b_91mpmteEihpOL2thL0RjDba7Bcn4aqUiY,761
139
139
  orionis/container/enums/lifetimes.py,sha256=RqQmugMIB1Ev_j_vFLcWorndm-to7xg4stQ7yKFDdDw,190
140
140
  orionis/container/exceptions/container_exception.py,sha256=cmoiDR2LvQ4AnxxZL-F3JdeI18ux7CzKmsCki98DAEk,585
141
141
  orionis/container/exceptions/type_error_exception.py,sha256=T1x0vNY_i6pj3dyQ8atFKGY-Cs20Ep7EHq0RWvxpNMM,531
@@ -231,7 +231,7 @@ orionis/foundation/config/testing/enums/test_mode.py,sha256=IbFpauu7J-iSAfmC8jDb
231
231
  orionis/foundation/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
232
232
  orionis/foundation/contracts/config.py,sha256=Rpz6U6t8OXHO9JJKSTnCimytXE-tfCB-1ithP2nG8MQ,628
233
233
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
234
- orionis/metadata/framework.py,sha256=qeWjf-r_TPkpB9eRQmFbJgPl2m72cDZKLyPOsBuhT-E,4960
234
+ orionis/metadata/framework.py,sha256=DivzhWwEMU-eP536LW7YhRVNUZY1LsNVI9u24eMHSMU,4960
235
235
  orionis/metadata/package.py,sha256=tqLfBRo-w1j_GN4xvzUNFyweWYFS-qhSgAEc-AmCH1M,5452
236
236
  orionis/patterns/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
237
237
  orionis/patterns/singleton/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -256,7 +256,7 @@ orionis/services/environment/exceptions/environment_value_exception.py,sha256=zl
256
256
  orionis/services/introspection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
257
257
  orionis/services/introspection/reflection.py,sha256=AI5ZMv9kHCLOQe9lL_G7wAeY3cPLKZ1FMYqIhU0yS-M,2972
258
258
  orionis/services/introspection/abstract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
259
- orionis/services/introspection/abstract/reflection_abstract.py,sha256=uLE3HaJzQYomI952nEJEn3zU04Wva1mRPm5FdBViswY,43333
259
+ orionis/services/introspection/abstract/reflection_abstract.py,sha256=CyINJAMU9rHitnAYow7NsNnjobeQNMzxlcfXEp1kmQ4,43087
260
260
  orionis/services/introspection/abstract/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
261
261
  orionis/services/introspection/abstract/contracts/reflection_abstract.py,sha256=-ugpFcAkGTlk0Md5ft8NrvupnlfVji8QZjGYqWBxqeY,22370
262
262
  orionis/services/introspection/concretes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -342,7 +342,7 @@ orionis/test/suite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
342
342
  orionis/test/suite/test_unit.py,sha256=5UTdCYmD_Yz8asaBF54RHOx0kjwjLjEhkyPDoDIxk-k,57049
343
343
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
344
344
  orionis/test/view/render.py,sha256=jXZkbITBknbUwm_mD8bcTiwLDvsFkrO9qrf0ZgPwqxc,4903
345
- orionis-0.309.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
345
+ orionis-0.310.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
346
346
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
347
347
  tests/example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
348
348
  tests/example/test_example.py,sha256=kvWgiW3ADEZf718dGsMPtDh_rmOSx1ypEInKm7_6ZPQ,601
@@ -441,8 +441,8 @@ tests/support/wrapper/test_services_wrapper_docdict.py,sha256=yeVwl-VcwkWSQYyxZu
441
441
  tests/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
442
442
  tests/testing/test_testing_result.py,sha256=MrGK3ZimedL0b5Ydu69Dg8Iul017AzLTm7VPxpXlpfU,4315
443
443
  tests/testing/test_testing_unit.py,sha256=A6QkiOkP7GPC1Szh_GqsrV7GxjWjK8cIwFez6YfrzmM,7683
444
- orionis-0.309.0.dist-info/METADATA,sha256=NP8L6MenHHCxaOvsCVLicSJIrg3y27Vr5T12TgE8NDw,4772
445
- orionis-0.309.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
446
- orionis-0.309.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
447
- orionis-0.309.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
448
- orionis-0.309.0.dist-info/RECORD,,
444
+ orionis-0.310.0.dist-info/METADATA,sha256=j_tLGkYMJ7muy6ayifaGYlSYh63t1miFcCh4kF87aGU,4772
445
+ orionis-0.310.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
446
+ orionis-0.310.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
447
+ orionis-0.310.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
448
+ orionis-0.310.0.dist-info/RECORD,,