osbot-utils 1.38.0__py3-none-any.whl → 1.39.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.
@@ -26,6 +26,7 @@ def cache_on_self(function: T) -> T:
26
26
  def wrapper(*args, **kwargs):
27
27
  if len(args) == 0 or inspect.isclass(type(args[0])) is False:
28
28
  raise Exception("In Method_Wrappers.cache_on_self could not find self")
29
+ # todo: fix bug that happens when the value of reload_cache is set to False
29
30
  if 'reload_cache' in kwargs: # if the reload parameter is set to True
30
31
  reload_cache = True # set reload to True
31
32
  del kwargs['reload_cache'] # remove the reload parameter from the kwargs
@@ -8,11 +8,18 @@ class Temp_Env_Vars(Type_Safe):
8
8
  original_env_vars: dict
9
9
 
10
10
  def __enter__(self):
11
+ return self.set_vars()
12
+
13
+ def __exit__(self, exc_type, exc_value, traceback):
14
+ self.restore_vars()
15
+
16
+ def set_vars(self):
11
17
  for key, value in self.env_vars.items():
12
18
  self.original_env_vars[key] = os.environ.get(key) # Backup original environment variables and set new ones
13
19
  os.environ[key] = value
20
+ return self
14
21
 
15
- def __exit__(self, exc_type, exc_value, traceback):
22
+ def restore_vars(self):
16
23
  for key in self.env_vars: # Restore original environment variables
17
24
  if self.original_env_vars[key] is None:
18
25
  del os.environ[key]
osbot_utils/version CHANGED
@@ -1 +1 @@
1
- v1.38.0
1
+ v1.39.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: osbot_utils
3
- Version: 1.38.0
3
+ Version: 1.39.0
4
4
  Summary: OWASP Security Bot - Utils
5
5
  Home-page: https://github.com/owasp-sbot/OSBot-Utils
6
6
  License: MIT
@@ -22,7 +22,7 @@ Description-Content-Type: text/markdown
22
22
 
23
23
  Powerful Python util methods and classes that simplify common apis and tasks.
24
24
 
25
- ![Current Release](https://img.shields.io/badge/release-v1.38.0-blue)
25
+ ![Current Release](https://img.shields.io/badge/release-v1.39.0-blue)
26
26
  [![codecov](https://codecov.io/gh/owasp-sbot/OSBot-Utils/graph/badge.svg?token=GNVW0COX1N)](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
27
27
 
28
28
 
@@ -18,7 +18,7 @@ osbot_utils/decorators/lists/index_by.py,sha256=BEbfd13l11zROhXAb0vkB_aZi9P2Zt4p
18
18
  osbot_utils/decorators/methods/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  osbot_utils/decorators/methods/cache.py,sha256=IMmHBeR6qtaOfBNgZUeI1SVLoexQQy6vk1LDW-20_5w,1062
20
20
  osbot_utils/decorators/methods/cache_on_function.py,sha256=sDebxWjJnusb_w4R26OTYcmTF6CCeWrpesn-dgzEu8g,2694
21
- osbot_utils/decorators/methods/cache_on_self.py,sha256=zhE1YoYma8eyx9i7dpTmpdrVzf5CkBJRe9aYok9xlgs,3527
21
+ osbot_utils/decorators/methods/cache_on_self.py,sha256=FODnv36jAwNPs11j2fGg6u-4A7MdaeRd1ES6fyPgP78,3611
22
22
  osbot_utils/decorators/methods/cache_on_tmp.py,sha256=8wLnRAUUkHobu6-B2Q8aAE8jLeIu3b-CQuMtXcnIN9w,3102
23
23
  osbot_utils/decorators/methods/capture_exception.py,sha256=mTfjqIS_qvZLhX6_NF_fkD_EnMLZRXkUHqUaiAbqZkU,1160
24
24
  osbot_utils/decorators/methods/capture_status.py,sha256=5xklG0usO3hGTjedhrmIucXtUjPd2pkuvA5jsty0a5E,659
@@ -253,7 +253,7 @@ osbot_utils/testing/Profiler.py,sha256=4em6Lpp0ONRDoDDCZsc_CdAOi_QolKOp4eA7KHN96
253
253
  osbot_utils/testing/Pytest.py,sha256=R3qdsIXGcNQcu7iobz0RB8AhbbHhc6t757tZoSZRrxA,730
254
254
  osbot_utils/testing/Stderr.py,sha256=ynf0Wle9NvgneLChzAxFBQ0QlE5sbri_fzJ8bEJMNkc,718
255
255
  osbot_utils/testing/Stdout.py,sha256=Gmxd_dOplXlucdSbOhYhka9sWP-Hmqb7ZuLs_JjtW7Y,592
256
- osbot_utils/testing/Temp_Env_Vars.py,sha256=oFuaegBlaV0aySkPe1Nzf-mdIKN03oTUKNfKijGz__M,751
256
+ osbot_utils/testing/Temp_Env_Vars.py,sha256=CE_lk54QcibkQVtIj2DrQPS3k2LgQZUctU5b-WwWvbo,884
257
257
  osbot_utils/testing/Temp_File.py,sha256=yZBL9MmcNU4PCQ4xlF4rSss4GylKoX3T_AJF-BlQhdI,1693
258
258
  osbot_utils/testing/Temp_Folder.py,sha256=Dbcohr2ciex6w-kB79R41Nuoa0pgpDbKtPGnlMmJ73k,5194
259
259
  osbot_utils/testing/Temp_Sys_Path.py,sha256=gOMD-7dQYQlejoDYUqsrmuZQ9DLC07ymPZB3zYuNmG4,256
@@ -288,8 +288,8 @@ osbot_utils/utils/Toml.py,sha256=dqiegndCJF7V1YT1Tc-b0-Bl6QWyL5q30urmQwMXfMQ,140
288
288
  osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
289
289
  osbot_utils/utils/Zip.py,sha256=riPLKkZJxQjVu8lCm19cOTx5uiLPm1HreB9_BzNXi30,12209
290
290
  osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
291
- osbot_utils/version,sha256=0nfWeSLY7TCuC1ABX0OW6t1UI9kbFtRJw6PqE6oH7xs,8
292
- osbot_utils-1.38.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
293
- osbot_utils-1.38.0.dist-info/METADATA,sha256=aOTN_LvtbeozSVNCqnnkyaHYPbny6vxZJJf2s7DknLs,1266
294
- osbot_utils-1.38.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
295
- osbot_utils-1.38.0.dist-info/RECORD,,
291
+ osbot_utils/version,sha256=fWfv3M5aLzIMdVIWJcenCiN596BO4a0gEyF73y5p_xY,8
292
+ osbot_utils-1.39.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
293
+ osbot_utils-1.39.0.dist-info/METADATA,sha256=SY4oAlcFR6WCUnCBX1Zq20PQ2sqLHpL2uQeTA3PuwuY,1266
294
+ osbot_utils-1.39.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
295
+ osbot_utils-1.39.0.dist-info/RECORD,,