atomicshop 2.11.31__py3-none-any.whl → 2.11.33__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.31'
4
+ __version__ = '2.11.33'
@@ -173,6 +173,14 @@ def install_docker_ubuntu(
173
173
  with permissions.temporary_regular_permissions():
174
174
  ubuntu_terminal.add_path_to_bashrc(as_regular_user=True)
175
175
 
176
+ # Add appropriate permissions to the docker socket, so the user can run docker commands without sudo in python.
177
+ # process.execute_script('export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock', shell=True)
178
+ ubuntu_terminal.add_line_to_bashrc(
179
+ 'export DOCKER_HOST=unix:///run/user/1000/docker.sock', as_regular_user=True)
180
+ # process.execute_script('export DOCKER_HOST=unix:///run/user/1000/docker.sock', shell=True)
181
+ # Restart shell.
182
+ process.execute_script('source ~/.bashrc', shell=True)
183
+
176
184
  if add_current_user_to_docker_group_bool:
177
185
  # Check if current user that executed the script is a sudo user. If not, use the current user.
178
186
  # Add the current user to the docker group.
@@ -66,10 +66,10 @@ def create_docker_image_ubuntu(directory_path: str):
66
66
  cd fact_extractor
67
67
 
68
68
  # Start docker service.
69
- sudo service docker start
69
+ # sudo service docker start
70
70
 
71
71
  # Build the Docker image
72
- sudo docker build -t fact_extractor .
72
+ docker build -t fact_extractor .
73
73
  """
74
74
 
75
75
  # Execute the script.
@@ -249,6 +249,32 @@ def add_path_to_bashrc(as_regular_user: bool = False):
249
249
  print("$HOME/bin already in .bashrc")
250
250
 
251
251
 
252
+ def add_line_to_bashrc(line: str, as_regular_user: bool = False):
253
+ """Add a line to the .bashrc file.
254
+ :param line: str, the line to add to the .bashrc file.
255
+ :param as_regular_user: bool, if True, the function will run as a regular user even if executed with sudo.
256
+ """
257
+ home_path_bashrc = "~/.bashrc"
258
+
259
+ if as_regular_user:
260
+ # Get the current non-sudo user
261
+ with permissions.temporary_regular_permissions():
262
+ current_non_sudo_user = os.getlogin()
263
+
264
+ # Get the home path of the current non-sudo user
265
+ user_bashrc_path = permissions.expand_user_path(current_non_sudo_user, home_path_bashrc)
266
+ else:
267
+ user_bashrc_path = os.path.expanduser(home_path_bashrc)
268
+
269
+ with open(user_bashrc_path, 'r+') as bashrc:
270
+ content = bashrc.read()
271
+ if line not in content:
272
+ bashrc.write(line)
273
+ print(f"Added line to .bashrc: {line}")
274
+ else:
275
+ print(f"Line already in .bashrc: {line}")
276
+
277
+
252
278
  def get_command_execution_as_sudo_executer(command: str, add_bash_exec: bool = False) -> str:
253
279
  """
254
280
  Function gets the command execution as the sudo executer.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.11.31
3
+ Version: 2.11.33
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=xdq2T3fc83KYz4JSRLWxu2X6waCsgS3DzUq-w8q_Wxs,124
1
+ atomicshop/__init__.py,sha256=ElNFm1xlHGTTIyNkpUGD1aAlY-7WIrsz0ufochoo2-g,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
@@ -152,7 +152,7 @@ atomicshop/wrappers/olefilew.py,sha256=biD5m58rogifCYmYhJBrAFb9O_Bn_spLek_9HofLe
152
152
  atomicshop/wrappers/pipw.py,sha256=mu4jnHkSaYNfpBiLZKMZxEX_E2LqW5BVthMZkblPB_c,1317
153
153
  atomicshop/wrappers/process_wrapper_pbtk.py,sha256=ycPmBRnv627RWks6N8OhxJQe8Gu3h3Vwj-4HswPOw0k,599
154
154
  atomicshop/wrappers/pyopensslw.py,sha256=OBWxA6EJ2vU_Qlf4M8m6ilcG3hyYB4yB0EsXUf7NhEU,6804
155
- atomicshop/wrappers/ubuntu_terminal.py,sha256=Kodf7FLBplqfLR86YaXb-JlkRVORPgLVS5P6aHkx-Vg,9541
155
+ atomicshop/wrappers/ubuntu_terminal.py,sha256=pK8Ie9bCRl0qWlx_243aqj_K9nrd-ZqS8RIJF1vcvjw,10554
156
156
  atomicshop/wrappers/wslw.py,sha256=AKphiHLSddL7ErevUowr3f9Y1AgGz_R3KZ3NssW07h8,6959
157
157
  atomicshop/wrappers/certauthw/certauth.py,sha256=hKedW0DOWlEigSNm8wu4SqHkCQsGJ1tJfH7s4nr3Bk0,12223
158
158
  atomicshop/wrappers/certauthw/certauthw.py,sha256=4WvhjANI7Kzqrr_nKmtA8Kf7B6rute_5wfP65gwQrjw,8082
@@ -165,7 +165,7 @@ atomicshop/wrappers/ctyping/msi_windows_installer/extract_msi_main.py,sha256=eyF
165
165
  atomicshop/wrappers/ctyping/msi_windows_installer/tables.py,sha256=ajiFiLXl1prg2kOhatfT8E2RKX7F8JjUJpwkVuKu1GY,16263
166
166
  atomicshop/wrappers/dockerw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
167
167
  atomicshop/wrappers/dockerw/dockerw.py,sha256=w8zSJr5C7cbvbuG09ORCpAe0BOcibqqL_Z2EKEBHYK4,6266
168
- atomicshop/wrappers/dockerw/install_docker.py,sha256=VAr5AB08lglsILBTnm0m2sMTcTFMCNZplfFFPVa2R2Q,8909
168
+ atomicshop/wrappers/dockerw/install_docker.py,sha256=YdwERVvmVgV0A2YwC78AKVTxZsLbTHivlhsEKKRrR28,9464
169
169
  atomicshop/wrappers/elasticsearchw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
170
170
  atomicshop/wrappers/elasticsearchw/config_basic.py,sha256=fDujtrjEjbWiYh_WQ3OcYp_8mXhXPYeKLy4wSPL5qM0,1177
171
171
  atomicshop/wrappers/elasticsearchw/elasticsearchw.py,sha256=7TqFdEFznO8NlligJhEKk1vm641ALpCYdaRl1uoXdzM,9768
@@ -184,7 +184,7 @@ atomicshop/wrappers/factw/config_fact.py,sha256=J-K9Zn50WcDC7ubb-boraSZExfBk7a6M
184
184
  atomicshop/wrappers/factw/config_install.py,sha256=N-6Fg4Z_aG33r0WGlYgBQTFnamJceYyW4XjnGyyNAks,555
185
185
  atomicshop/wrappers/factw/get_file_data.py,sha256=ChKC0OjgjFlNubZQBwcGhRO3L2pccc27RLRlAMIUix4,1641
186
186
  atomicshop/wrappers/factw/fact_extractor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
187
- atomicshop/wrappers/factw/fact_extractor/docker_image.py,sha256=jJAoJNQ4aoATjn3x_va031Obb4oBtcqCY40hydghm0s,2504
187
+ atomicshop/wrappers/factw/fact_extractor/docker_image.py,sha256=2FyYjnw8gxFNwISQ83OwH-iGivkFi6EAluyCZ0loHEQ,2501
188
188
  atomicshop/wrappers/factw/fact_extractor/get_extractor.py,sha256=2mfOAftHIlCcGt1s7MWdq7DsDCuI6wX3MtvcEZ4SK-0,756
189
189
  atomicshop/wrappers/factw/install/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
190
190
  atomicshop/wrappers/factw/install/install_after_restart.py,sha256=-VXC3KDX2BzF0oi0ELCmfch55vLk-3t16KxlmYyUGD8,1560
@@ -243,8 +243,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
243
243
  atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
244
244
  atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
245
245
  atomicshop/wrappers/socketw/statistics_csv.py,sha256=t3dtDEfN47CfYVi0CW6Kc2QHTEeZVyYhc57IYYh5nmA,826
246
- atomicshop-2.11.31.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
247
- atomicshop-2.11.31.dist-info/METADATA,sha256=_fktED1otCwlk4d6JXqv0BPc0rWYp2ZVgie__CsappA,10448
248
- atomicshop-2.11.31.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
249
- atomicshop-2.11.31.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
250
- atomicshop-2.11.31.dist-info/RECORD,,
246
+ atomicshop-2.11.33.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
247
+ atomicshop-2.11.33.dist-info/METADATA,sha256=xXajZWlHGXQhbaOgJkaUhNLnBvfSpEkea2tz2P2BbQs,10448
248
+ atomicshop-2.11.33.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
249
+ atomicshop-2.11.33.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
250
+ atomicshop-2.11.33.dist-info/RECORD,,