osbot-utils 2.10.0__py3-none-any.whl → 2.11.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.
@@ -65,23 +65,23 @@ class Type_Safe:
65
65
  def __enter__(self): return self
66
66
  def __exit__(self, exc_type, exc_val, exc_tb): pass
67
67
 
68
- def __getattr__(self, name): # Called when an attribute is not found through normal attribute access
69
- if name.startswith(("set_", "get_")): # Check if the requested attribute is a getter or setter method
70
- prefix = name[:4] # Extract "set_" or "get_" from the method name
71
- attr_name = name[4:] # Get the actual attribute name by removing the prefix
72
-
73
- if hasattr(self, attr_name): # Verify that the target attribute actually exists on the object
74
- if prefix == "set_": # Handle setter method creation
75
- def setter(value): # Create a dynamic setter function that takes a value parameter
76
- setattr(self, attr_name, value) # Set the attribute value using type-safe setattr from Type_Safe
77
- return self # Return self for method chaining
78
- return setter # Return the setter function
79
- else: # get_ # Handle getter method creation
80
- def getter(): # Create a dynamic getter function with no parameters
81
- return getattr(self, attr_name) # Return the attribute value using Python's built-in getattr
82
- return getter # Return the getter function
83
-
84
- raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'") # Raise error if attribute is not a valid getter/setter
68
+ # def __getattr__(self, name): # Called when an attribute is not found through normal attribute access
69
+ # if name.startswith(("set_", "get_")): # Check if the requested attribute is a getter or setter method
70
+ # prefix = name[:4] # Extract "set_" or "get_" from the method name
71
+ # attr_name = name[4:] # Get the actual attribute name by removing the prefix
72
+ #
73
+ # if hasattr(self, attr_name): # Verify that the target attribute actually exists on the object
74
+ # if prefix == "set_": # Handle setter method creation
75
+ # def setter(value): # Create a dynamic setter function that takes a value parameter
76
+ # setattr(self, attr_name, value) # Set the attribute value using type-safe setattr from Type_Safe
77
+ # return self # Return self for method chaining
78
+ # return setter # Return the setter function
79
+ # else: # get_ # Handle getter method creation
80
+ # def getter(): # Create a dynamic getter function with no parameters
81
+ # return getattr(self, attr_name) # Return the attribute value using Python's built-in getattr
82
+ # return getter # Return the getter function
83
+ #
84
+ # raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'") # Raise error if attribute is not a valid getter/setter
85
85
 
86
86
  def __setattr__(self, name, value):
87
87
  from osbot_utils.utils.Objects import convert_dict_to_value_from_obj_annotation
@@ -2,7 +2,7 @@ from typing import TypeVar, Type, Optional
2
2
 
3
3
  T = TypeVar('T')
4
4
 
5
- def type_safe_property(target_path: str, target_name: str, expected_type: Optional[Type[T]] = None) -> property: # Creates a type-safe property that delegates get/set operations to a nested data object
5
+ def type_safe_property(target_path: str, target_name: str, expected_type: Optional[Type[T]] = None) -> T: # Creates a type-safe property that delegates get/set operations to a nested data object
6
6
 
7
7
  def getter(self) -> T:
8
8
  target = self
osbot_utils/version CHANGED
@@ -1 +1 @@
1
- v2.10.0
1
+ v2.11.0
@@ -1,8 +1,7 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: osbot_utils
3
- Version: 2.10.0
3
+ Version: 2.11.0
4
4
  Summary: OWASP Security Bot - Utils
5
- Home-page: https://github.com/owasp-sbot/OSBot-Utils
6
5
  License: MIT
7
6
  Author: Dinis Cruz
8
7
  Author-email: dinis.cruz@owasp.org
@@ -16,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
17
16
  Classifier: Programming Language :: Python :: 3.12
18
17
  Classifier: Programming Language :: Python :: 3.13
18
+ Project-URL: Homepage, https://github.com/owasp-sbot/OSBot-Utils
19
19
  Project-URL: Repository, https://github.com/owasp-sbot/OSBot-Utils
20
20
  Description-Content-Type: text/markdown
21
21
 
@@ -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
- ![Current Release](https://img.shields.io/badge/release-v2.10.0-blue)
26
+ ![Current Release](https://img.shields.io/badge/release-v2.11.0-blue)
27
27
  [![codecov](https://codecov.io/gh/owasp-sbot/OSBot-Utils/graph/badge.svg?token=GNVW0COX1N)](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
28
28
 
29
29
 
@@ -277,7 +277,7 @@ osbot_utils/testing/Temp_Zip_In_Memory.py,sha256=ibDIWt3K4CX558PbkLbX3InHyWYZcwQ
277
277
  osbot_utils/testing/Unit_Test.py,sha256=MReR_wDGbbXFDPz7cmuGflcTxRB6TBnO9mYqRpSq8Pk,1304
278
278
  osbot_utils/testing/Unzip_File.py,sha256=V5H97XO9rlvG5EYOSzAH4kTtAH1ohZ8R8ImvJh46ZNg,1177
279
279
  osbot_utils/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
280
- osbot_utils/type_safe/Type_Safe.py,sha256=RTi44N_p_gVO4-w6MwvRErv6z4DR-Vgv_X1JjfDV36M,31488
280
+ osbot_utils/type_safe/Type_Safe.py,sha256=E_8BLAQe_kBAbWCMuwEK-ScKLyHeLiaLRnRzVXJ79lE,31528
281
281
  osbot_utils/type_safe/Type_Safe__Base.py,sha256=mL8GMaR9tsaUfwk8d-8zp2g-A8kNKiN6kroEFaNvMOk,5518
282
282
  osbot_utils/type_safe/Type_Safe__Dict.py,sha256=I_Ac0JH-ahmQrkADFVyiobTlH1JI31MKHaNszQW4PBo,2396
283
283
  osbot_utils/type_safe/Type_Safe__List.py,sha256=SzSIBkwSOAEpW_V2qh4-f0YHzmgB0T8PczBLbDgZGvg,1340
@@ -286,7 +286,7 @@ osbot_utils/type_safe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
286
286
  osbot_utils/type_safe/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
287
287
  osbot_utils/type_safe/decorators/type_safe.py,sha256=ERFfJuAIo5qLp03YEDu2zu5wxu65OhR7hOybwuTfLlc,1006
288
288
  osbot_utils/type_safe/methods/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
289
- osbot_utils/type_safe/methods/type_safe_property.py,sha256=wl_wNPOZDWcNeb3JqRJLyYW0we-fZW6AylIil58VwyI,1432
289
+ osbot_utils/type_safe/methods/type_safe_property.py,sha256=DcJkOIs6swJtkglsZVKLyFSczCGSJISOVwAmvjCOQvo,1425
290
290
  osbot_utils/type_safe/validators/Type_Safe__Validator.py,sha256=cJIPSBarjV716SZUOLvz7Mthjk-aUYKUQtRDtKUBmN4,779
291
291
  osbot_utils/type_safe/validators/Validator__Max.py,sha256=pCvYF5Jb_cBgn1ArGhf6FNUB-NGCXPq3D36oYDCyAzg,1275
292
292
  osbot_utils/type_safe/validators/Validator__Min.py,sha256=_-9MdAX2Jc2U0VzCHpEQLA8OVxuNe2y8uaJ6bQttimE,1981
@@ -319,8 +319,8 @@ osbot_utils/utils/Toml.py,sha256=Rxl8gx7mni5CvBAK-Ai02EKw-GwtJdd3yeHT2kMloik,166
319
319
  osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
320
320
  osbot_utils/utils/Zip.py,sha256=pR6sKliUY0KZXmqNzKY2frfW-YVQEVbLKiyqQX_lc-8,14052
321
321
  osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
322
- osbot_utils/version,sha256=Ig2saA_Dl-WLDWVJ1pUIVm-766x_oeaEUPDVaiPvL1E,8
323
- osbot_utils-2.10.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
324
- osbot_utils-2.10.0.dist-info/METADATA,sha256=wRx8uQb-akkXW9mMeB7vpFFk153AlGmRit1wykmyhHw,1317
325
- osbot_utils-2.10.0.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
326
- osbot_utils-2.10.0.dist-info/RECORD,,
322
+ osbot_utils/version,sha256=8xjRdD2gnCK6Bmp10NtMht0sx27toOXEGGCPQqpLeMY,8
323
+ osbot_utils-2.11.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
324
+ osbot_utils-2.11.0.dist-info/METADATA,sha256=1fIjOeYVk7hZ1DJ6hISNnlDtVlDi2UejZWBn4iTAPBo,1329
325
+ osbot_utils-2.11.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
326
+ osbot_utils-2.11.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.0
2
+ Generator: poetry-core 2.0.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any