atomicshop 2.11.32__py3-none-any.whl → 2.11.34__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.32'
4
+ __version__ = '2.11.34'
@@ -174,10 +174,14 @@ def install_docker_ubuntu(
174
174
  ubuntu_terminal.add_path_to_bashrc(as_regular_user=True)
175
175
 
176
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
- process.execute_script('export DOCKER_HOST=unix:///run/user/1000/docker.sock', shell=True)
177
+ with open('/etc/profile.d/docker_vars.sh', 'w') as file:
178
+ file.write('export DOCKER_HOST=unix:///run/user/1000/docker.sock')
179
+
180
+ # ubuntu_terminal.add_line_to_bashrc(
181
+ # 'export DOCKER_HOST=unix:///run/user/1000/docker.sock', as_regular_user=True)
182
+ # process.execute_script('export DOCKER_HOST=unix:///run/user/1000/docker.sock', shell=True)
179
183
  # Restart shell.
180
- process.execute_script('source ~/.bashrc', shell=True)
184
+ # process.execute_script('source ~/.bashrc', shell=True)
181
185
 
182
186
  if add_current_user_to_docker_group_bool:
183
187
  # Check if current user that executed the script is a sudo user. If not, use the current user.
@@ -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.32
3
+ Version: 2.11.34
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=KVdm-OdRa3eg-hrRk4P9g-vvJdV28OXyYH4UeADQ3L4,124
1
+ atomicshop/__init__.py,sha256=jH96O2I5IFLYzcv2-W6eD1sNe1woWqU3T4-4KnAT3fE,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=ez4xffAszl_TTNprVCylLO9SnNp5c3JZg9ulZO7CrcE,9326
168
+ atomicshop/wrappers/dockerw/install_docker.py,sha256=YUsp_tbQkjWzFtGqnQtdaskr_jg3nudxIhfwnDUFYz8,9514
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
@@ -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.32.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
247
- atomicshop-2.11.32.dist-info/METADATA,sha256=L9sbxCDrgqVwqyqqqleGWkNdCM8IyWZMOzVzKBgAujE,10448
248
- atomicshop-2.11.32.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
249
- atomicshop-2.11.32.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
250
- atomicshop-2.11.32.dist-info/RECORD,,
246
+ atomicshop-2.11.34.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
247
+ atomicshop-2.11.34.dist-info/METADATA,sha256=c7w8Xloy9e-I542mNfJEqF41i-T5NAXHpLqfUwiloOU,10448
248
+ atomicshop-2.11.34.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
249
+ atomicshop-2.11.34.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
250
+ atomicshop-2.11.34.dist-info/RECORD,,