atomicshop 2.12.21__py3-none-any.whl → 2.12.22__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.21'
4
+ __version__ = '2.12.22'
@@ -105,7 +105,11 @@ def write_list_to_csv(
105
105
  mode: str = 'w'
106
106
  ) -> None:
107
107
  """
108
- Function to write list object that each iteration of it contains dict object with same keys and different values.
108
+ This function got dual purpose:
109
+ 1. Write list object that each iteration of it contains list object with same length.
110
+ 2. Write list object that each iteration of it contains dict object with same keys and different values.
111
+ The dictionary inside the function will be identified by the first iteration of the list.
112
+ Other objects (inside the provided list) than dictionary will be identified as regular objects.
109
113
 
110
114
  :param file_path: Full file path to CSV file.
111
115
  :param content_list: List object that each iteration contains dictionary with same keys and different values.
@@ -113,7 +117,7 @@ def write_list_to_csv(
113
117
  :return: None.
114
118
  """
115
119
 
116
- with open(file_path, mode=mode) as csv_file:
120
+ with open(file_path, mode=mode, newline='') as csv_file:
117
121
  if len(content_list) > 0 and isinstance(content_list[0], dict):
118
122
  # Treat the list as list of dictionaries.
119
123
  header = content_list[0].keys()
@@ -1,13 +1,11 @@
1
- import time
2
- from typing import Union
3
1
  import os
4
2
 
5
- from . import included_files, fw_files, virtual_file_path, file_object, analysis
6
- from .. import config_fact, get_file_data
3
+ from . import fw_files, virtual_file_path, file_object, analysis
4
+ from .. import config_fact
7
5
  from ....print_api import print_api, print_status_of_list
8
- from ....file_io import file_io, jsons, csvs
6
+ from ....file_io import jsons, csvs
9
7
  from ....basics import dicts
10
- from .... import filesystem, ip_addresses
8
+ from .... import ip_addresses
11
9
  from ...psycopgw import psycopgw
12
10
 
13
11
 
@@ -113,6 +113,10 @@ def get_logs_paths(
113
113
  logs_files = []
114
114
  else:
115
115
  logs_files = [logs_files[-2]]
116
+ # If there is only one file, meaning it is the current day log.
117
+ # If the 'previous_day_only' is True, then there are no previous day logs to output.
118
+ elif len(logs_files) == 1 and previous_day_only:
119
+ logs_files = []
116
120
 
117
121
  return logs_files
118
122
 
@@ -309,7 +313,8 @@ def get_latest_lines(
309
313
  log_type='csv',
310
314
  previous_day_only=True
311
315
  )[0]['file_path']
312
- except KeyError:
316
+ # If you get IndexError, it means that there are no previous day logs to read.
317
+ except IndexError:
313
318
  pass
314
319
 
315
320
  # Count all the rotated files.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.12.21
3
+ Version: 2.12.22
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=LSUgsf6XY377_4Z2xaHNOnKX7HYoq7IlSOu4OJMwzf0,124
1
+ atomicshop/__init__.py,sha256=g2vsW13t8sldcuaaZZDrssh2JaK2htDJxU8zZNrBFoM,124
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
@@ -104,7 +104,7 @@ atomicshop/etw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
104
104
  atomicshop/etw/dns_trace.py,sha256=I4OZsiZUDyj7B4fKTOqsB1tcX1DUMw9uh4CwXlcmHfY,5571
105
105
  atomicshop/etw/etw.py,sha256=xVJNbfCq4KgRfsDnul6CrIdAMl9xRBixZ-hUyqiB2g4,2403
106
106
  atomicshop/file_io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
- atomicshop/file_io/csvs.py,sha256=WOtDyVFhhA1RD3yrU9P33kDY1EKFEz8UmVCUkqYKuog,5503
107
+ atomicshop/file_io/csvs.py,sha256=y8cJtnlN-NNxNupzJgSeGq9aQ4wNxYLFPX9vNNlUiIc,5830
108
108
  atomicshop/file_io/docxs.py,sha256=6tcYFGp0vRsHR47VwcRqwhdt2DQOwrAUYhrwN996n9U,5117
109
109
  atomicshop/file_io/file_io.py,sha256=FOZ6_PjOASxSDHESe4fwDv5miXYR10OHTxkxtEHoZYQ,6555
110
110
  atomicshop/file_io/jsons.py,sha256=q9ZU8slBKnHLrtn3TnbK1qxrRpj5ZvCm6AlsFzoANjo,5303
@@ -201,7 +201,7 @@ atomicshop/wrappers/factw/install/pre_install_and_install_before_restart.py,sha2
201
201
  atomicshop/wrappers/factw/postgresql/__init__.py,sha256=xMBn2d3Exo23IPP2F_9-SXmOlhFbwWDgS9KwozSTjA0,162
202
202
  atomicshop/wrappers/factw/postgresql/analysis.py,sha256=2Rxzy2jyq3zEKIo53z8VkjuslKE_i5mq2ZpmJAvyd6U,716
203
203
  atomicshop/wrappers/factw/postgresql/file_object.py,sha256=VRiCXnsd6yDbnsE-TEKYPC-gkAgFVkE6rygRrJLQShI,713
204
- atomicshop/wrappers/factw/postgresql/firmware.py,sha256=wnohSnSOCmlTUCzzHIIPGkRrnownlGKgIFyhhdhNEoA,10759
204
+ atomicshop/wrappers/factw/postgresql/firmware.py,sha256=ywPn8yBAliX4FO7ZqfrPsGPZMxBTPLSwEmex4pz1CZ8,10668
205
205
  atomicshop/wrappers/factw/postgresql/fw_files.py,sha256=P1jq4AAZa7fygWdEZtFJOnfz4tyqmPpvFzEMDKrCRkU,1291
206
206
  atomicshop/wrappers/factw/postgresql/included_files.py,sha256=sn5YhLkrsvjhrVSA8O8YUNfbqR9STprSuQGEnHsK0jE,1025
207
207
  atomicshop/wrappers/factw/postgresql/virtual_file_path.py,sha256=iR68A_My_ohgRcYdueMaQF9EHOgBRN3bIi8Nq59g3kc,1098
@@ -218,7 +218,7 @@ atomicshop/wrappers/loggingw/formatters.py,sha256=mUtcJJfmhLNrwUVYShXTmdu40dBaJu
218
218
  atomicshop/wrappers/loggingw/handlers.py,sha256=2A_3Qy1B0RvVWZmQocAB6CmpqlXoKJ-yi6iBWG2jNLo,8274
219
219
  atomicshop/wrappers/loggingw/loggers.py,sha256=DHOOTAtqkwn1xgvLHSkOiBm6yFGNuQy1kvbhG-TDog8,2374
220
220
  atomicshop/wrappers/loggingw/loggingw.py,sha256=m6YySEedP3_4Ik1S_uGMxETSbmRkmMYmAZxhHBlXSlo,16616
221
- atomicshop/wrappers/loggingw/reading.py,sha256=OgKDuYV8KD3brXD82_UIQLPGL6qUeFINcFOYxVIi8Q8,15347
221
+ atomicshop/wrappers/loggingw/reading.py,sha256=iRXwPHhwkzuBFz4nlRdO9fpfxnNCYRE09r8JvtqTcao,15671
222
222
  atomicshop/wrappers/nodejsw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
223
  atomicshop/wrappers/nodejsw/install_nodejs.py,sha256=QZg-R2iTQt7kFb8wNtnTmwraSGwvUs34JIasdbNa7ZU,5154
224
224
  atomicshop/wrappers/playwrightw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -254,8 +254,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
254
254
  atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
255
255
  atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
256
256
  atomicshop/wrappers/socketw/statistics_csv.py,sha256=t3dtDEfN47CfYVi0CW6Kc2QHTEeZVyYhc57IYYh5nmA,826
257
- atomicshop-2.12.21.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
258
- atomicshop-2.12.21.dist-info/METADATA,sha256=iWSjLaN-XwW8NsBxqu8wdQPgrJZZv1EaZ7-x4e_Tglo,10479
259
- atomicshop-2.12.21.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
260
- atomicshop-2.12.21.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
261
- atomicshop-2.12.21.dist-info/RECORD,,
257
+ atomicshop-2.12.22.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
258
+ atomicshop-2.12.22.dist-info/METADATA,sha256=754IBZW-ExlLv33i93QGyMKGQOEXOrw1uIsXmERVvKM,10479
259
+ atomicshop-2.12.22.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
260
+ atomicshop-2.12.22.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
261
+ atomicshop-2.12.22.dist-info/RECORD,,