wcp-library 1.2.1__py3-none-any.whl → 1.2.3__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.
wcp_library/__init__.py CHANGED
@@ -13,3 +13,16 @@ if getattr(sys, 'frozen', False):
13
13
  application_path = Path(application_path).parent
14
14
  else:
15
15
  application_path = Path().absolute()
16
+
17
+
18
+ def divide_chunks(list_obj: list, size: int) -> list:
19
+ """
20
+ Divide a list into chunks of size
21
+
22
+ :param list_obj:
23
+ :param size:
24
+ :return:
25
+ """
26
+
27
+ for i in range(0, len(list_obj), size):
28
+ yield list_obj[i:i + size]
wcp_library/logging.py CHANGED
@@ -22,13 +22,16 @@ def create_log(file_level: int, console_level: int, iterations: int, project_nam
22
22
  :return:
23
23
  """
24
24
 
25
- for i in range(iterations-1, 0, -1):
26
- if (application_path / (project_name + f"_{i}.log")).exists():
27
- (application_path / (project_name + f"_{i}.log")).rename((application_path / (project_name + f"_{i+1}.log")))
28
- if (application_path / (project_name + ".log")).exists():
29
- (application_path / (project_name + ".log")).rename((application_path / (project_name + "_1.log")))
30
- if (application_path / (project_name + f"_{iterations}.log")).exists():
31
- (application_path / (project_name + f"_{iterations}.log")).unlink()
25
+ possible_iterative_filenames = [(application_path / (project_name + ".log"))] + [application_path / (project_name + f"_{i + 1}.log") for i in range(iterations)]
26
+
27
+ if iterations == 0:
28
+ (application_path / (project_name + ".log")).unlink(missing_ok=True)
29
+ else:
30
+ last_file = possible_iterative_filenames[-1]
31
+ last_file.unlink(missing_ok=True)
32
+
33
+ for i in range(iterations, 0, -1):
34
+ possible_iterative_filenames[i - 1].rename(possible_iterative_filenames[i])
32
35
 
33
36
  logging.basicConfig(
34
37
  filename=(application_path / (project_name + ".log")),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wcp-library
3
- Version: 1.2.1
3
+ Version: 1.2.3
4
4
  Summary: Common utilites for internal development at WCP
5
5
  Home-page: https://github.com/Whitecap-DNA/WCP-Library
6
6
  Author: Mitch-Petersen
@@ -1,4 +1,4 @@
1
- wcp_library/__init__.py,sha256=7JG050lnLc-Djo5MyftR_keI7-vZjlBwmx-LLdEVUCM,349
1
+ wcp_library/__init__.py,sha256=hwLbcu00uI6L_xjXO9-I0YcODl2WtIOkdNLoDcXv7zk,591
2
2
  wcp_library/async_credentials/__init__.py,sha256=ny6UitVV_xIecVzaWuHrJO9LpywBPke6u4C0F2wiM7o,1881
3
3
  wcp_library/async_credentials/api.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  wcp_library/async_credentials/oracle.py,sha256=MvC7wsHnSyAyPGnRVlH0dvvW2xk5ap_IAByoHX4rUWY,5436
@@ -15,11 +15,11 @@ wcp_library/ftp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  wcp_library/ftp/ftp.py,sha256=EpyW0J2QIGxP8zVGD4VarA0hi4C2XAPDPF-0j2sRdpI,4350
16
16
  wcp_library/ftp/sftp.py,sha256=hykXGLGdxe7DYAxFdTwjPjTEOYuIpSMyK3NOiTQNUK0,4176
17
17
  wcp_library/informatica.py,sha256=IXZtk_9X1XLbOEwFrsyOwTgajQKvtXgANBHmuTOP3Kk,4064
18
- wcp_library/logging.py,sha256=tpnEuet-V6SK68JWk5cpt4K51YO0AxaebXrwGDGabFs,2048
18
+ wcp_library/logging.py,sha256=AXWoSx_eje7n_it31wJrUV-7iZUu31PRXv1B1jyqFp8,1996
19
19
  wcp_library/selenium_helper.py,sha256=rlphTXsUgnbaXZknY5nfQqxFhnc7UmrpzhV3hQ-cv7k,2509
20
20
  wcp_library/sql/__init__.py,sha256=CLlBEBrWVAwE79bUxuQiwikSrYH8m9QRYSJ2l0-ofsY,1003
21
21
  wcp_library/sql/oracle.py,sha256=a0wc9zwBdzhZCZFRWxZlokDJEEt-HqhqmwRbtp2T8ZA,7342
22
22
  wcp_library/sql/postgres.py,sha256=397Ii0ImjEo_e_QuWJRazfs0WpT9cGrnc6sBPyr4UyY,6596
23
- wcp_library-1.2.1.dist-info/METADATA,sha256=OTbh7b1itfvVpO9ex6-yxz6MP9ZsjvKF_C9UFDdEcwk,1513
24
- wcp_library-1.2.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
25
- wcp_library-1.2.1.dist-info/RECORD,,
23
+ wcp_library-1.2.3.dist-info/METADATA,sha256=-_Wl7vbXyJAGnEEHwKOS6f74nTODhr3F8mUKYJmE8mk,1513
24
+ wcp_library-1.2.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
25
+ wcp_library-1.2.3.dist-info/RECORD,,