kisa-utils 0.36.5__py3-none-any.whl → 0.36.6__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.
- kisa_utils/functionUtils.py +4 -12
- kisa_utils/structures/utils.py +0 -1
- kisa_utils/structures/validator.py +0 -2
- {kisa_utils-0.36.5.dist-info → kisa_utils-0.36.6.dist-info}/METADATA +1 -1
- {kisa_utils-0.36.5.dist-info → kisa_utils-0.36.6.dist-info}/RECORD +7 -7
- {kisa_utils-0.36.5.dist-info → kisa_utils-0.36.6.dist-info}/WHEEL +0 -0
- {kisa_utils-0.36.5.dist-info → kisa_utils-0.36.6.dist-info}/top_level.txt +0 -0
kisa_utils/functionUtils.py
CHANGED
|
@@ -121,22 +121,14 @@ def enforceRequirements(func):
|
|
|
121
121
|
if Response == expectectedReturnType: return Error(log)
|
|
122
122
|
raise ValueError(log)
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
functionResp = func(*args, **kwargs)
|
|
125
125
|
|
|
126
126
|
# if not isinstance(resp, expectectedReturnType):
|
|
127
|
-
if not (resp := validateWithResponse(
|
|
128
|
-
if Response == expectectedReturnType: return Error(log)
|
|
127
|
+
if not (resp := validateWithResponse(functionResp, expectectedReturnType)):
|
|
128
|
+
if Response == expectectedReturnType: return Error(resp.log)
|
|
129
129
|
|
|
130
130
|
raise TypeError(f'`{func.__name__}` return error: {resp.log}')
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
# log = f'`{func.__name__}` returned `{resp.__name__}`, expected `{expectectedReturnType}`'
|
|
134
|
-
# else:
|
|
135
|
-
# log = f'`{func.__name__}` returned `{type(resp).__name__}`, expected `{expectectedReturnType}`'
|
|
136
|
-
|
|
137
|
-
# if Response == expectectedReturnType: return Error(log)
|
|
138
|
-
# raise TypeError(log)
|
|
139
|
-
|
|
140
|
-
return resp
|
|
132
|
+
return functionResp
|
|
141
133
|
|
|
142
134
|
return w
|
kisa_utils/structures/utils.py
CHANGED
|
@@ -20,10 +20,8 @@ def validate(instance:Any, structure:Any, path:str='$') -> dict:
|
|
|
20
20
|
|
|
21
21
|
result = {'status':False, 'log':''}
|
|
22
22
|
|
|
23
|
-
# print(instance, structure, end=' => ')
|
|
24
23
|
if not isinstance(structure, UnionType) and get_origin(structure):
|
|
25
24
|
structure = get_origin(structure)
|
|
26
|
-
# print(instance, structure)
|
|
27
25
|
|
|
28
26
|
# union types such as int|float...
|
|
29
27
|
if isinstance(structure, UnionType):
|
|
@@ -7,7 +7,7 @@ kisa_utils/db.py,sha256=qMOPfBHz9qJIKUwGvSk32EyyhvEFqOpDv0MX4QseXl0,40788
|
|
|
7
7
|
kisa_utils/encryption.py,sha256=KwSUtjZj6m2JqEeeg0GW3bx93PCpEwJlcBzLZrnReyE,3522
|
|
8
8
|
kisa_utils/enqueue.py,sha256=RbImgoPNFFCQHT1ow9zJEM-tHwWE1bNnHznJqEVXL9k,11290
|
|
9
9
|
kisa_utils/figures.py,sha256=ossQHBR7T9rOV1yhQJLDbwrY23xf0RIGOmjcFH7P0ss,1860
|
|
10
|
-
kisa_utils/functionUtils.py,sha256=
|
|
10
|
+
kisa_utils/functionUtils.py,sha256=5Le76lzAwX8id2a_4fiKe-TxzGPgCQqlStJxBux2EZg,5345
|
|
11
11
|
kisa_utils/log.py,sha256=EKBAVvDpY_hgALDCC6i-ARdqQzZwxBxxeHR4NsYgs9U,2120
|
|
12
12
|
kisa_utils/queues.py,sha256=D0bCtI95VEg-xLuzf-Wp0Pfjc5hoEwlmzEJHuokx-i0,5418
|
|
13
13
|
kisa_utils/remote.py,sha256=2EMG2kJudCYqpNPsACe3riQCqTsg-MzviVSZPbjCtxk,1793
|
|
@@ -21,9 +21,9 @@ kisa_utils/permissions/__init__.py,sha256=k7WbNlE8i9Vyf_SdbXbTh8D3gt4obDe3f8rONV
|
|
|
21
21
|
kisa_utils/servers/__init__.py,sha256=lPqDyGTrFo0qwPZ2WA9Xtcpc5D8AIU4huqgFx1iZf68,19
|
|
22
22
|
kisa_utils/servers/flask.py,sha256=niD6Cv04cs6YVMXB7MVjOQ4__78UfLLia7qHdz2FgUs,30354
|
|
23
23
|
kisa_utils/structures/__init__.py,sha256=JBU1j3A42jQ62ALKnsS1Hav9YXcYwjDw1wQJtohXPbU,83
|
|
24
|
-
kisa_utils/structures/utils.py,sha256=
|
|
25
|
-
kisa_utils/structures/validator.py,sha256=
|
|
26
|
-
kisa_utils-0.36.
|
|
27
|
-
kisa_utils-0.36.
|
|
28
|
-
kisa_utils-0.36.
|
|
29
|
-
kisa_utils-0.36.
|
|
24
|
+
kisa_utils/structures/utils.py,sha256=M4qBWjkrG9grHgIu_OZ6TEISsHRtZq5hF-S4mScelgs,2484
|
|
25
|
+
kisa_utils/structures/validator.py,sha256=8FTi_GDPTNplxNJLTH8DraNyHZPjYFRvPBlI0sIvjBE,3573
|
|
26
|
+
kisa_utils-0.36.6.dist-info/METADATA,sha256=aRNZkVFERaJ2HyJ3_RGmIfmEQO4Lsie7smO5jGf4eTo,477
|
|
27
|
+
kisa_utils-0.36.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
28
|
+
kisa_utils-0.36.6.dist-info/top_level.txt,sha256=URxY4sRuqmirOxWtztpVmPoGQdksEMYO6hmYsEDGz2Y,75
|
|
29
|
+
kisa_utils-0.36.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|