atomicshop 2.12.4__py3-none-any.whl → 2.12.6__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.

Potentially problematic release.


This version of atomicshop might be problematic. Click here for more details.

atomicshop/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  """Atomic Basic functions and classes to make developer life easier"""
2
2
 
3
3
  __author__ = "Den Kras"
4
- __version__ = '2.12.4'
4
+ __version__ = '2.12.6'
@@ -0,0 +1,9 @@
1
+ from atomicshop.wrappers import pycharmw
2
+
3
+
4
+ def main():
5
+ pycharmw.download_install_main()
6
+
7
+
8
+ if __name__ == "__main__":
9
+ main()
@@ -72,44 +72,45 @@ def get_logs_paths(
72
72
  add_last_modified_time=True,
73
73
  sort_by_last_modified_time=True)
74
74
 
75
- if date_pattern:
76
- latest_timestamp: float = 0
77
- for file_index, single_file in enumerate(logs_files):
78
- # Get file name from current loop file path.
79
- current_file_name: str = Path(single_file['file_path']).name
80
- # Get the datetime object from the file name by the date pattern.
81
- try:
82
- datetime_object = datetimes.get_datetime_from_complex_string_by_pattern(current_file_name, date_pattern)
83
- timestamp_float = datetime_object.timestamp()
84
- # ValueError will be raised if the date pattern does not match the file name.
85
- except ValueError:
86
- timestamp_float = 0
87
- # Update the last modified time to the dictionary.
88
- logs_files[file_index]['last_modified'] = timestamp_float
89
-
90
- if timestamp_float > latest_timestamp:
91
- latest_timestamp = timestamp_float
92
-
93
- # Now, there should be a file that doesn't have the string date pattern in the file name.
94
- # We will add one day to the latest date that we found and assign to that file path.
95
- for file_index, single_file in enumerate(logs_files):
96
- if single_file['last_modified'] == 0:
97
- latest_timestamp += 86400
98
- logs_files[file_index]['last_modified'] = latest_timestamp
99
- break
100
-
101
- # Sort the files by the last modified time.
102
- logs_files = sorted(logs_files, key=lambda x: x['last_modified'], reverse=False)
103
-
104
- if latest_only:
105
- logs_files = [logs_files[-1]]
106
-
107
- if previous_day_only:
108
- # Check if there is a previous day log file.
109
- if len(logs_files) == 1:
110
- logs_files = []
111
- else:
112
- logs_files = [logs_files[-2]]
75
+ if len(logs_files) > 1:
76
+ if date_pattern:
77
+ latest_timestamp: float = 0
78
+ for file_index, single_file in enumerate(logs_files):
79
+ # Get file name from current loop file path.
80
+ current_file_name: str = Path(single_file['file_path']).name
81
+ # Get the datetime object from the file name by the date pattern.
82
+ try:
83
+ datetime_object = datetimes.get_datetime_from_complex_string_by_pattern(current_file_name, date_pattern)
84
+ timestamp_float = datetime_object.timestamp()
85
+ # ValueError will be raised if the date pattern does not match the file name.
86
+ except ValueError:
87
+ timestamp_float = 0
88
+ # Update the last modified time to the dictionary.
89
+ logs_files[file_index]['last_modified'] = timestamp_float
90
+
91
+ if timestamp_float > latest_timestamp:
92
+ latest_timestamp = timestamp_float
93
+
94
+ # Now, there should be a file that doesn't have the string date pattern in the file name.
95
+ # We will add one day to the latest date that we found and assign to that file path.
96
+ for file_index, single_file in enumerate(logs_files):
97
+ if single_file['last_modified'] == 0:
98
+ latest_timestamp += 86400
99
+ logs_files[file_index]['last_modified'] = latest_timestamp
100
+ break
101
+
102
+ # Sort the files by the last modified time.
103
+ logs_files = sorted(logs_files, key=lambda x: x['last_modified'], reverse=False)
104
+
105
+ if latest_only:
106
+ logs_files = [logs_files[-1]]
107
+
108
+ if previous_day_only:
109
+ # Check if there is a previous day log file.
110
+ if len(logs_files) == 1:
111
+ logs_files = []
112
+ else:
113
+ logs_files = [logs_files[-2]]
113
114
 
114
115
  return logs_files
115
116
 
@@ -248,12 +249,17 @@ def get_latest_lines(
248
249
  previous_file_lines: list = []
249
250
 
250
251
  # Get the latest statistics file path.
251
- latest_statistics_file_path: str = get_logs_paths(
252
+ latest_statistics_file_path_object = get_logs_paths(
252
253
  log_file_path=log_file_path,
253
254
  date_pattern=date_pattern,
254
255
  log_type='csv',
255
256
  latest_only=True
256
- )[0]['file_path']
257
+ )
258
+
259
+ if not latest_statistics_file_path_object:
260
+ return [], [], [], []
261
+
262
+ latest_statistics_file_path: str = latest_statistics_file_path_object[0]['file_path']
257
263
 
258
264
  # Get the previous day statistics file path.
259
265
  previous_day_statistics_file_path: Union[str, None] = None
@@ -0,0 +1,56 @@
1
+ import requests
2
+ import os
3
+ import subprocess
4
+ import tempfile
5
+
6
+
7
+ # URL to the PyCharm Community Edition download page
8
+ PYCHARM_DOWNLOAD_URL = 'https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=windows&code=PCC'
9
+
10
+
11
+ def download_install_main():
12
+ """
13
+ Main function to download and install the latest PyCharm Community Edition.
14
+
15
+ Usage:
16
+ python -m atomicshop.mains.installs.pycharm
17
+
18
+ Or run the main function directly.
19
+ from atomicshop.wrappers import pycharmw
20
+
21
+
22
+ def main():
23
+ pycharmw.download_install_main()
24
+
25
+
26
+ if __name__ == "__main__":
27
+ main()
28
+ """
29
+
30
+ # Get the redirect URL for the download
31
+ response = requests.get(PYCHARM_DOWNLOAD_URL, allow_redirects=True)
32
+
33
+ # Extract the final download URL
34
+ download_url = response.url
35
+
36
+ # Get the file name from the download URL
37
+ file_name = download_url.split('/')[-1]
38
+
39
+ # Create a temporary directory to download the installer
40
+ temp_dir = tempfile.mkdtemp()
41
+ installer_path = os.path.join(temp_dir, file_name)
42
+
43
+ # Download the installer
44
+ print(f"Downloading {file_name}...")
45
+ with requests.get(download_url, stream=True) as r:
46
+ r.raise_for_status()
47
+ with open(installer_path, 'wb') as f:
48
+ for chunk in r.iter_content(chunk_size=8192):
49
+ f.write(chunk)
50
+ print("Download complete.")
51
+
52
+ # Install PyCharm
53
+ # Run the installer
54
+ print("Running the installer...")
55
+ subprocess.run([installer_path, '/S'], check=True) # /S for silent installation
56
+ print("Installation complete.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.12.4
3
+ Version: 2.12.6
4
4
  Summary: Atomic functions and classes to make developer life easier
5
5
  Author: Denis Kras
6
6
  License: MIT License
@@ -1,4 +1,4 @@
1
- atomicshop/__init__.py,sha256=A6TgdSzIf8j0mMvGKZ3xk-S6OpZAVrTeT1tDyVDSnUA,123
1
+ atomicshop/__init__.py,sha256=TLPRMvhKFttMuXR3ePlfcfwTL8XQTiNL0vl1IZUyWUE,123
2
2
  atomicshop/_basics_temp.py,sha256=6cu2dd6r2dLrd1BRNcVDKTHlsHs_26Gpw8QS6v32lQ0,3699
3
3
  atomicshop/_create_pdf_demo.py,sha256=Yi-PGZuMg0RKvQmLqVeLIZYadqEZwUm-4A9JxBl_vYA,3713
4
4
  atomicshop/_patch_import.py,sha256=ENp55sKVJ0e6-4lBvZnpz9PQCt3Otbur7F6aXDlyje4,6334
@@ -111,6 +111,7 @@ atomicshop/file_io/jsons.py,sha256=q9ZU8slBKnHLrtn3TnbK1qxrRpj5ZvCm6AlsFzoANjo,5
111
111
  atomicshop/file_io/tomls.py,sha256=oa0Wm8yMkPRXKN9jgBuTnKbioSOee4mABW5IMUFCYyU,3041
112
112
  atomicshop/file_io/xlsxs.py,sha256=v_dyg9GD4LqgWi6wA1QuWRZ8zG4ZwB6Dz52ytdcmmmI,2184
113
113
  atomicshop/file_io/xmls.py,sha256=zh3SuK-dNaFq2NDNhx6ivcf4GYCfGM8M10PcEwDSpxk,2104
114
+ atomicshop/mains/installs/pycharm.py,sha256=uYTfME7hOeNkAsOZxDDPj2hDqmkxrFqVV6Nv6xnYNVk,141
114
115
  atomicshop/mitm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
116
  atomicshop/mitm/connection_thread_worker.py,sha256=PQ8bwOgrPudYP5oPnSi_DWaKXOi038M8TMImlLkxuPI,20486
116
117
  atomicshop/mitm/import_config.py,sha256=_V-IVJ7a1L6E-VOR4CDfZj-S1odbsIlBe13ij0NlpqY,7974
@@ -155,6 +156,7 @@ atomicshop/wrappers/numpyw.py,sha256=sBV4gSKyr23kXTalqAb1oqttzE_2XxBooCui66jbAqc
155
156
  atomicshop/wrappers/olefilew.py,sha256=biD5m58rogifCYmYhJBrAFb9O_Bn_spLek_9HofLeYE,2051
156
157
  atomicshop/wrappers/pipw.py,sha256=mu4jnHkSaYNfpBiLZKMZxEX_E2LqW5BVthMZkblPB_c,1317
157
158
  atomicshop/wrappers/process_wrapper_pbtk.py,sha256=ycPmBRnv627RWks6N8OhxJQe8Gu3h3Vwj-4HswPOw0k,599
159
+ atomicshop/wrappers/pycharmw.py,sha256=Ar7SDG15HD-GUiLH-Mclo7xpoPj9nzSXg4ks63lL8fw,1642
158
160
  atomicshop/wrappers/pyopensslw.py,sha256=OBWxA6EJ2vU_Qlf4M8m6ilcG3hyYB4yB0EsXUf7NhEU,6804
159
161
  atomicshop/wrappers/ubuntu_terminal.py,sha256=BBZD3EH6KSDORd5IZBZM-ti4U6Qh1sZwftx42s7hqB4,10917
160
162
  atomicshop/wrappers/wslw.py,sha256=AKphiHLSddL7ErevUowr3f9Y1AgGz_R3KZ3NssW07h8,6959
@@ -214,7 +216,7 @@ atomicshop/wrappers/loggingw/formatters.py,sha256=mUtcJJfmhLNrwUVYShXTmdu40dBaJu
214
216
  atomicshop/wrappers/loggingw/handlers.py,sha256=qm5Fbu8eDmlstMduUe5nKUlJU5IazFkSnQizz8Qt2os,5479
215
217
  atomicshop/wrappers/loggingw/loggers.py,sha256=DHOOTAtqkwn1xgvLHSkOiBm6yFGNuQy1kvbhG-TDog8,2374
216
218
  atomicshop/wrappers/loggingw/loggingw.py,sha256=v9WAseZXB50LluT9rIUcRvvevg2nLVKPgz3dbGejfV0,12151
217
- atomicshop/wrappers/loggingw/reading.py,sha256=iGvX2jMeeeF_CaPim2Gf8kbOxhK6ISfE-qgAfQs_j6g,13141
219
+ atomicshop/wrappers/loggingw/reading.py,sha256=iw7tIN8rBFIJ7zKKPHhAGWRK4I_OE79qMg9EYsN2HkE,13462
218
220
  atomicshop/wrappers/nodejsw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
219
221
  atomicshop/wrappers/nodejsw/install_nodejs.py,sha256=QZg-R2iTQt7kFb8wNtnTmwraSGwvUs34JIasdbNa7ZU,5154
220
222
  atomicshop/wrappers/playwrightw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -249,8 +251,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
249
251
  atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
250
252
  atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
251
253
  atomicshop/wrappers/socketw/statistics_csv.py,sha256=t3dtDEfN47CfYVi0CW6Kc2QHTEeZVyYhc57IYYh5nmA,826
252
- atomicshop-2.12.4.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
253
- atomicshop-2.12.4.dist-info/METADATA,sha256=FFW2CBNFQycJ9fgKb3ZJFVmR0s2lZR_1YNhGyaDOdQ8,10447
254
- atomicshop-2.12.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
255
- atomicshop-2.12.4.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
256
- atomicshop-2.12.4.dist-info/RECORD,,
254
+ atomicshop-2.12.6.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
255
+ atomicshop-2.12.6.dist-info/METADATA,sha256=10_ghq5UFkTcqxD9GFqX7Bov01aZvlg4N7XRktoDL9s,10447
256
+ atomicshop-2.12.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
257
+ atomicshop-2.12.6.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
258
+ atomicshop-2.12.6.dist-info/RECORD,,