orionis 0.238.0__py3-none-any.whl → 0.240.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/support/introspection/__init__.py +1 -2
- orionis/luminate/support/introspection/abstracts/__init__.py +0 -0
- orionis/luminate/support/introspection/{reflect_abstract.py → abstracts/reflect_abstract.py} +66 -2
- orionis/luminate/support/introspection/contracts/reflexion_abstract.py +0 -1
- orionis/luminate/support/introspection/instances/contracts/__init__.py +0 -0
- orionis/luminate/support/introspection/instances/contracts/reflection_instance.py +644 -0
- orionis/luminate/support/introspection/instances/reflection_instance.py +4 -1
- orionis/luminate/support/introspection/reflection.py +1 -1
- orionis/luminate/support/introspection/reflexion_concrete_with_abstract.py +1 -1
- orionis/luminate/support/introspection/reflexion_instance_with_abstract.py +1 -1
- orionis/luminate/test/output/contracts/__init__.py +0 -0
- {orionis-0.238.0.dist-info → orionis-0.240.0.dist-info}/METADATA +1 -1
- {orionis-0.238.0.dist-info → orionis-0.240.0.dist-info}/RECORD +21 -17
- tests/support/inspection/fakes/{fake_reflection_abstract.py → fake_reflect_abstract.py} +2 -0
- tests/support/inspection/test_reflect_abstract.py +273 -0
- tests/support/inspection/test_reflect_instance.py +1 -0
- tests/support/inspection/test_reflection_abstract.py +0 -255
- {orionis-0.238.0.dist-info → orionis-0.240.0.dist-info}/LICENCE +0 -0
- {orionis-0.238.0.dist-info → orionis-0.240.0.dist-info}/WHEEL +0 -0
- {orionis-0.238.0.dist-info → orionis-0.240.0.dist-info}/entry_points.txt +0 -0
- {orionis-0.238.0.dist-info → orionis-0.240.0.dist-info}/top_level.txt +0 -0
orionis/framework.py
CHANGED
File without changes
|
orionis/luminate/support/introspection/{reflect_abstract.py → abstracts/reflect_abstract.py}
RENAMED
@@ -25,8 +25,12 @@ class ReflexionAbstract(IReflexionAbstract):
|
|
25
25
|
"""Initialize with the abstract class."""
|
26
26
|
self._abstract = abstract
|
27
27
|
|
28
|
+
def parse(self) -> None:
|
29
|
+
pass
|
30
|
+
|
28
31
|
def getClassName(self) -> str:
|
29
|
-
"""
|
32
|
+
"""
|
33
|
+
Get the name of the abstract class.
|
30
34
|
|
31
35
|
Returns
|
32
36
|
-------
|
@@ -35,8 +39,23 @@ class ReflexionAbstract(IReflexionAbstract):
|
|
35
39
|
"""
|
36
40
|
return self._abstract.__name__
|
37
41
|
|
42
|
+
def getClass(self) -> RuntimeError:
|
43
|
+
"""
|
44
|
+
Retrieve the class of the abstract base class.
|
45
|
+
This method is intended to be overridden in subclasses to provide
|
46
|
+
the actual abstract class. By default, it raises a RuntimeError
|
47
|
+
since abstract classes cannot be instantiated directly.
|
48
|
+
The abstract base class itself.
|
49
|
+
Raises
|
50
|
+
------
|
51
|
+
RuntimeError
|
52
|
+
If called directly on the abstract class.
|
53
|
+
"""
|
54
|
+
raise RuntimeError("Cannot instantiate an abstract class.")
|
55
|
+
|
38
56
|
def getModuleName(self) -> str:
|
39
|
-
"""
|
57
|
+
"""
|
58
|
+
Get the name of the module where the abstract class is defined.
|
40
59
|
|
41
60
|
Returns
|
42
61
|
-------
|
@@ -45,6 +64,51 @@ class ReflexionAbstract(IReflexionAbstract):
|
|
45
64
|
"""
|
46
65
|
return self._abstract.__module__
|
47
66
|
|
67
|
+
def getAllAttributes(self) -> Dict[str, Any]:
|
68
|
+
"""
|
69
|
+
Get all attributes of the abstract class.
|
70
|
+
|
71
|
+
Returns
|
72
|
+
-------
|
73
|
+
Dict[str, Any]
|
74
|
+
Dictionary of attribute names and their values
|
75
|
+
"""
|
76
|
+
attributes = {
|
77
|
+
name: value for name, value in vars(self._abstract).items()
|
78
|
+
if not callable(value) and not isinstance(value, (staticmethod, classmethod, property))
|
79
|
+
and not isinstance(value, types.MemberDescriptorType)
|
80
|
+
}
|
81
|
+
class_name = self.getClassName()
|
82
|
+
public = {}
|
83
|
+
private = {}
|
84
|
+
protected = {}
|
85
|
+
|
86
|
+
for attr, value in attributes.items():
|
87
|
+
if (str(attr).startswith("__") and str(attr).endswith("__")) or str(attr).startswith("_abc_"):
|
88
|
+
continue
|
89
|
+
if str(attr).startswith("_") and not str(attr).startswith("__") and not str(attr).startswith(f"_{class_name}"):
|
90
|
+
protected[attr] = value
|
91
|
+
elif str(attr).startswith(f"_{class_name}"):
|
92
|
+
private[str(attr).replace(f"_{class_name}", "")] = value
|
93
|
+
else:
|
94
|
+
public[attr] = value
|
95
|
+
|
96
|
+
return {"public": public, "protected": protected, "private": private}
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
48
112
|
def getAbstractMethods(self) -> Set[str]:
|
49
113
|
"""Get all abstract method names required by the class.
|
50
114
|
|
File without changes
|