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.
@@ -121,22 +121,14 @@ def enforceRequirements(func):
121
121
  if Response == expectectedReturnType: return Error(log)
122
122
  raise ValueError(log)
123
123
 
124
- resp = func(*args, **kwargs)
124
+ functionResp = func(*args, **kwargs)
125
125
 
126
126
  # if not isinstance(resp, expectectedReturnType):
127
- if not (resp := validateWithResponse(resp, expectectedReturnType)):
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
- # if isinstance(resp, type):
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
@@ -57,7 +57,6 @@ class Value:
57
57
 
58
58
  @property
59
59
  def __name__(self) -> str:
60
- print(self._valueType)
61
60
  if not isinstance(self._valueType, UnionType):
62
61
  _type = (get_origin(self._valueType) or self._valueType).__name__
63
62
  else:
@@ -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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kisa-utils
3
- Version: 0.36.5
3
+ Version: 0.36.6
4
4
  Summary: Utility functions and modules for KISA Developers
5
5
  Author: Tom Bukenya
6
6
  Author-email: glayn2bukman@gmail.com
@@ -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=OPP9by-bpc7DssUFBpNNb0fPrUYxCnji4VlmxswHOrc,5718
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=svnzNyVL-wLBEgkovgrqDKvGM4wxYaQGuQ4fFDUR_mo,2515
25
- kisa_utils/structures/validator.py,sha256=ulqjXfgKEPdi8HxUA9qXvAudXCjzVNMtsiuSdNCI-rA,3651
26
- kisa_utils-0.36.5.dist-info/METADATA,sha256=mpxc6zax6sTD88roQb7IPdCVEYsqfnhmbOILXsFu6Vo,477
27
- kisa_utils-0.36.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
28
- kisa_utils-0.36.5.dist-info/top_level.txt,sha256=URxY4sRuqmirOxWtztpVmPoGQdksEMYO6hmYsEDGz2Y,75
29
- kisa_utils-0.36.5.dist-info/RECORD,,
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,,