berryworld 1.0.0.193968__py3-none-any.whl → 1.0.0.194033__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.
@@ -11,19 +11,24 @@ class PersistentStorage:
11
11
 
12
12
  def __init__(self, base=None):
13
13
  """ Workout the root and the base path
14
- :param base: Base path to be used for the project
14
+ :param base: Root folder to be used
15
15
  """
16
16
  if os.name == 'nt':
17
17
  root = os.getcwd()
18
18
  else:
19
19
  root = 'storage'
20
20
 
21
+ self.base_path = os.path.join(os.getcwd(), root)
22
+ if not self.if_exists(self.base_path):
23
+ raise ValueError(f"The persistent storage path: {self.base_path} is not properly set up.")
24
+
21
25
  if base is not None:
22
26
  self.base_path = os.path.join(os.getcwd(), root, base)
23
- else:
24
- self.base_path = os.path.join(os.getcwd(), root)
25
-
26
- self.connect()
27
+ if not self.if_exists(self.base_path):
28
+ try:
29
+ os.makedirs(self.base_path, exist_ok=True)
30
+ except:
31
+ raise ValueError(f"Couldn't create storage path: {self.base_path}.")
27
32
 
28
33
  def format_path(self, path_, sub_path=None):
29
34
  """ Format the path
@@ -49,11 +54,6 @@ class PersistentStorage:
49
54
  status = obj.exists()
50
55
  return status
51
56
 
52
- def connect(self):
53
- """ Check if the base path exists """
54
- if not self.if_exists(self.base_path):
55
- raise ValueError(f"The persistent storage path: {self.base_path} is not properly set up.")
56
-
57
57
  def return_base_path(self):
58
58
  """ Return the base path """
59
59
  return self.base_path
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: berryworld
3
- Version: 1.0.0.193968
3
+ Version: 1.0.0.194033
4
4
  Summary: Handy classes to improve ETL processes
5
5
  Home-page: https://www.berryworld.com
6
6
  Author: BerryWorld ltd
@@ -13,7 +13,7 @@ berryworld/handy_mix.py,sha256=ZPr5Z4l5TfyXQjhuLjttGi90whBooTQhB7M-Lq5L1DQ,10683
13
13
  berryworld/logging.py,sha256=tOxzaFALQm3aVVEc3I7t8MU6PwgUI9VSnzNCH9yRryo,1013
14
14
  berryworld/logic_apps.py,sha256=a0uU4tNO3v2w7grdBv-OOx4hUf7VBIerJpwZ9U-29dQ,14591
15
15
  berryworld/microsoft_teams.py,sha256=8uPo0yku-euBj2VdzBoZCeX3IcsCCOqISLqaVZUVxfA,16030
16
- berryworld/persistent_storage.py,sha256=fKdC36q5MqQTurq0TkJWrCbm4p9rj4cSFV33cbTU8fk,8588
16
+ berryworld/persistent_storage.py,sha256=L15kLyzN42T6UB1WAg8rFXJq3Mdb1M8Sw4P5YQaUN84,8711
17
17
  berryworld/pickle_management.py,sha256=5o6UuXBpTj23Jgpz6sj9V-vdcdWBK1xMEckWxT-Whj4,2436
18
18
  berryworld/power_automate.py,sha256=V86QEGG9H36DrDvod9Q6yp8OUu307hfYcXJhw06pYrA,27912
19
19
  berryworld/sharepoint_con.py,sha256=TuH-Vxk1VxjTi7x80KFssf_J8YPLRXpV27RBaFZi37U,22254
@@ -26,12 +26,12 @@ berryworld/verify_keys.py,sha256=X4Nuz3o0XbRDYofbJGvxIDeN5gfWj19PN7lhO6T3hR8,435
26
26
  berryworld/vivantio.py,sha256=QfZo0UKqkzVRg_LyiwivNd3aEup4TH57x4KxLZkCJwc,10627
27
27
  berryworld/vivantio_logging.py,sha256=ciy7gA4u3FrgUIpEBnMgocbNPp6jcu9TPoy-kLcrTZU,5736
28
28
  berryworld/xml_parser.py,sha256=HWD71NaTN3DaIOGT6Wzxs4CEsroFhGQwe9iPLIL80Co,957
29
- berryworld-1.0.0.193968.dist-info/licenses/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
29
+ berryworld-1.0.0.194033.dist-info/licenses/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
30
30
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  tests/test_allocation_config.py,sha256=e12l6fE9U57eSPS35g6ekJ_hol7-RHg89JV60_m1BlE,4633
32
32
  tests/test_handy_mix_config.py,sha256=Un56mz9KJmdn4K4OwzHAHLSRzDU1Xv2nFrONNuzOG04,2594
33
33
  tests/test_xml_parser.py,sha256=3QTlhFEd6KbK6nRFKZnc35tad6wqukTbe4QrFi8mr_8,859
34
- berryworld-1.0.0.193968.dist-info/METADATA,sha256=wwolMjQBxtyUn1NAmEF6jipmUumebMCqM2kwBfqNg_I,1445
35
- berryworld-1.0.0.193968.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
- berryworld-1.0.0.193968.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
37
- berryworld-1.0.0.193968.dist-info/RECORD,,
34
+ berryworld-1.0.0.194033.dist-info/METADATA,sha256=kI9FpxxzWBgrbA2HblYhdaf_8WEZeO7ybxESqGnRDKA,1445
35
+ berryworld-1.0.0.194033.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
+ berryworld-1.0.0.194033.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
37
+ berryworld-1.0.0.194033.dist-info/RECORD,,