osbot-utils 1.78.0__py3-none-any.whl → 1.80.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.
- osbot_utils/base_classes/Type_Safe.py +11 -6
- osbot_utils/version +1 -1
- {osbot_utils-1.78.0.dist-info → osbot_utils-1.80.0.dist-info}/METADATA +2 -2
- {osbot_utils-1.78.0.dist-info → osbot_utils-1.80.0.dist-info}/RECORD +6 -6
- {osbot_utils-1.78.0.dist-info → osbot_utils-1.80.0.dist-info}/LICENSE +0 -0
- {osbot_utils-1.78.0.dist-info → osbot_utils-1.80.0.dist-info}/WHEEL +0 -0
@@ -293,12 +293,17 @@ class Type_Safe:
|
|
293
293
|
value = self.deserialize_dict__using_key_value_annotations(key, value)
|
294
294
|
elif obj_is_attribute_annotation_of_type(self, key, list): # handle the case when the value is a list
|
295
295
|
attribute_annotation = obj_attribute_annotation(self, key) # get the annotation for this variable
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
296
|
+
attribute_annotation_args = get_args(attribute_annotation)
|
297
|
+
if attribute_annotation_args:
|
298
|
+
expected_type = get_args(attribute_annotation)[0] # get the first arg (which is the type)
|
299
|
+
type_safe_list = Type_Safe__List(expected_type) # create a new instance of Type_Safe__List
|
300
|
+
for item in value: # next we need to convert all items (to make sure they all match the type)
|
301
|
+
if type(item) is dict:
|
302
|
+
new_item = expected_type(**item) # create new object
|
303
|
+
else:
|
304
|
+
new_item = expected_type(item)
|
305
|
+
type_safe_list.append(new_item) # and add it to the new type_safe_list obejct
|
306
|
+
value = type_safe_list # todo: refactor out this create list code, maybe to an deserialize_from_list method
|
302
307
|
else:
|
303
308
|
if value is not None:
|
304
309
|
if obj_is_attribute_annotation_of_type(self, key, EnumMeta): # Handle the case when the value is an Enum
|
osbot_utils/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
v1.
|
1
|
+
v1.80.0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: osbot_utils
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.80.0
|
4
4
|
Summary: OWASP Security Bot - Utils
|
5
5
|
Home-page: https://github.com/owasp-sbot/OSBot-Utils
|
6
6
|
License: MIT
|
@@ -23,7 +23,7 @@ Description-Content-Type: text/markdown
|
|
23
23
|
|
24
24
|
Powerful Python util methods and classes that simplify common apis and tasks.
|
25
25
|
|
26
|
-

|
27
27
|
[](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
|
28
28
|
|
29
29
|
|
@@ -2,7 +2,7 @@ osbot_utils/__init__.py,sha256=DdJDmQc9zbQUlPVyTJOww6Ixrn9n4bD3ami5ItQfzJI,16
|
|
2
2
|
osbot_utils/base_classes/Cache_Pickle.py,sha256=kPCwrgUbf_dEdxUz7vW1GuvIPwlNXxuRhb-H3AbSpII,5884
|
3
3
|
osbot_utils/base_classes/Kwargs_To_Disk.py,sha256=HHoy05NC_w35WcT-OnSKoSIV_cLqaU9rdjH0_KNTM0E,1096
|
4
4
|
osbot_utils/base_classes/Kwargs_To_Self.py,sha256=weFNsBfBNV9W_qBkN-IdBD4yYcJV_zgTxBRO-ZlcPS4,141
|
5
|
-
osbot_utils/base_classes/Type_Safe.py,sha256=
|
5
|
+
osbot_utils/base_classes/Type_Safe.py,sha256=lAWsPoNGoLIrzjJ5xIHP_rlpTmeTP0eXbvnBKGEB1s0,22335
|
6
6
|
osbot_utils/base_classes/Type_Safe__List.py,sha256=iWyoc2xjHkTJrZTVnPse9Rljte2tF67oNq8yA7jnAhY,5996
|
7
7
|
osbot_utils/base_classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
osbot_utils/context_managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -306,8 +306,8 @@ osbot_utils/utils/Toml.py,sha256=-_Yv5T8ZhGGoDSSoNEdFhSsXiK_JPjGkPijm4JoeHSk,166
|
|
306
306
|
osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
|
307
307
|
osbot_utils/utils/Zip.py,sha256=pR6sKliUY0KZXmqNzKY2frfW-YVQEVbLKiyqQX_lc-8,14052
|
308
308
|
osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
309
|
-
osbot_utils/version,sha256=
|
310
|
-
osbot_utils-1.
|
311
|
-
osbot_utils-1.
|
312
|
-
osbot_utils-1.
|
313
|
-
osbot_utils-1.
|
309
|
+
osbot_utils/version,sha256=kZW8YcxtUgv8JJ5SMq_RAgJKr-SRwTryyrVMJjtd39o,8
|
310
|
+
osbot_utils-1.80.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
311
|
+
osbot_utils-1.80.0.dist-info/METADATA,sha256=GIgAeq1697iuS-tNNl4zTwOz4xA3-GzE2cX__pZc0fg,1317
|
312
|
+
osbot_utils-1.80.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
313
|
+
osbot_utils-1.80.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|