atomicshop 2.11.39__py3-none-any.whl → 2.11.41__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.11.39'
4
+ __version__ = '2.11.41'
@@ -113,18 +113,21 @@ def _search_in_archive(
113
113
  elif archive_type == '7z':
114
114
  file_info_list = arch_obj.list()
115
115
 
116
+ # Iterate over each file in the archive.
116
117
  for item_index, item in enumerate(file_info_list):
117
118
  if item.filename.endswith('/'): # Skip directories
118
119
  continue
119
120
 
120
121
  archived_file_bytes = None
122
+ # If the main archive is zip we will use the 'open' method, if it's 7z we will use the 'read' method.
121
123
  if archive_type == 'zip':
122
124
  with arch_obj.open(item) as file_data:
123
125
  archived_file_bytes = file_data.read()
124
126
  elif archive_type == '7z':
125
- file_dict = arch_obj.read(item.filename)
127
+ file_dict = arch_obj.read([item.filename])
126
128
  archived_file_bytes = file_dict[item.filename].read()
127
129
 
130
+ # After we get the file bytes we will check if the file matches the callback functions.
128
131
  callback_matched = False
129
132
  if callback_functions:
130
133
  callback_matched = _handle_callback_matching(
@@ -118,10 +118,12 @@ def install_nodejs_ubuntu(
118
118
  is_nodejs_installed()
119
119
 
120
120
 
121
- def install_npm_package_ubuntu(package_name: str):
121
+ def install_npm_package_ubuntu(package_name: str, sudo: bool = True):
122
122
  """
123
123
  The function will install a npm package on Ubuntu.
124
124
  :param package_name: str, the name of the package to install.
125
+ :param sudo: bool, if True, the function will use sudo.
126
+ NPM commands require sudo to install global packages.
125
127
  :return:
126
128
  """
127
129
 
@@ -130,4 +132,8 @@ def install_npm_package_ubuntu(package_name: str):
130
132
  return
131
133
 
132
134
  command = f"npm install -g {package_name}"
135
+
136
+ if sudo:
137
+ command = f"sudo {command}"
138
+
133
139
  _ = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.11.39
3
+ Version: 2.11.41
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=mfCEt9n_ZZ4wDpzMfn6LA520wsNaRoE_LoYzvrbpxkI,124
1
+ atomicshop/__init__.py,sha256=tUAnOkjuAjgtX6xm_4V4xBzywgnEL6Zmf8Af-HngudY,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
@@ -70,7 +70,7 @@ atomicshop/addons/process_list/compiled/Win10x64/process_list.lib,sha256=n9c2MVP
70
70
  atomicshop/archiver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
71
  atomicshop/archiver/_search_in_zip.py,sha256=dd8qFSvIhcKmtnPj_uYNJFPmMwZp4tZys0kKgTw_ACw,8385
72
72
  atomicshop/archiver/archiver.py,sha256=BomnK7zT-nQXA1z0i2R2aTv8eu88wPx7tf2HtOdbmEc,1280
73
- atomicshop/archiver/search_in_archive.py,sha256=kui33oobL2F3VLgAE8L037rHR8Ud3HpXz_E0tbuiDD4,10473
73
+ atomicshop/archiver/search_in_archive.py,sha256=lPQlBw6WXrV6Y57c6Pn6gaqVnXmY7mESdDCqFRv4BcU,10729
74
74
  atomicshop/archiver/sevenz_app_w.py,sha256=TEOhlZPzKqQPStmyIq5E_yP98brj1t_GuoBgeLXA4dA,3019
75
75
  atomicshop/archiver/sevenzs.py,sha256=5i_C50-deC1Cz_GQdMGofV2jeMPbbGWAvih-QnA72cg,1370
76
76
  atomicshop/archiver/zips.py,sha256=k742K1bEDtc_4N44j_Waebi-uOkxxavqltvV6q-BLW4,14402
@@ -211,7 +211,7 @@ atomicshop/wrappers/loggingw/loggers.py,sha256=DHOOTAtqkwn1xgvLHSkOiBm6yFGNuQy1k
211
211
  atomicshop/wrappers/loggingw/loggingw.py,sha256=v9WAseZXB50LluT9rIUcRvvevg2nLVKPgz3dbGejfV0,12151
212
212
  atomicshop/wrappers/loggingw/reading.py,sha256=xs7L6Jo-vedrhCVP7m-cJo0VhWmoSoK86avR4Tm0kG4,3675
213
213
  atomicshop/wrappers/nodejsw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
214
- atomicshop/wrappers/nodejsw/install_nodejs.py,sha256=VZvefvdeSzoyetCx1y8zg_liX3_GtFtpOpjw7P5iMLk,4956
214
+ atomicshop/wrappers/nodejsw/install_nodejs.py,sha256=QZg-R2iTQt7kFb8wNtnTmwraSGwvUs34JIasdbNa7ZU,5154
215
215
  atomicshop/wrappers/playwrightw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
216
216
  atomicshop/wrappers/playwrightw/_tryouts.py,sha256=l1BLkFsiIMNlgv7nfZd1XGEvXQkIQkIcg48__9OaC00,4920
217
217
  atomicshop/wrappers/playwrightw/base.py,sha256=WeRpx8otdXuKSr-BjY-uCJTze21kbPpfitoOjKQz5-g,9818
@@ -244,8 +244,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
244
244
  atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
245
245
  atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
246
246
  atomicshop/wrappers/socketw/statistics_csv.py,sha256=t3dtDEfN47CfYVi0CW6Kc2QHTEeZVyYhc57IYYh5nmA,826
247
- atomicshop-2.11.39.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
248
- atomicshop-2.11.39.dist-info/METADATA,sha256=EDFFCYfHnP59uWkVJYODbOGZryZHiwM0xMJWAL2WN_g,10448
249
- atomicshop-2.11.39.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
250
- atomicshop-2.11.39.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
251
- atomicshop-2.11.39.dist-info/RECORD,,
247
+ atomicshop-2.11.41.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
248
+ atomicshop-2.11.41.dist-info/METADATA,sha256=i03LBYdEFEwR0yzXsJi3iLc_RXkjD_htdIE4M-gWOJg,10448
249
+ atomicshop-2.11.41.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
250
+ atomicshop-2.11.41.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
251
+ atomicshop-2.11.41.dist-info/RECORD,,