atomicshop 2.9.26__py3-none-any.whl → 2.9.28__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 +1 -1
- atomicshop/permissions.py +12 -0
- atomicshop/wrappers/dockerw/install_docker.py +13 -4
- {atomicshop-2.9.26.dist-info → atomicshop-2.9.28.dist-info}/METADATA +1 -1
- {atomicshop-2.9.26.dist-info → atomicshop-2.9.28.dist-info}/RECORD +8 -8
- {atomicshop-2.9.26.dist-info → atomicshop-2.9.28.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.9.26.dist-info → atomicshop-2.9.28.dist-info}/WHEEL +0 -0
- {atomicshop-2.9.26.dist-info → atomicshop-2.9.28.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/permissions.py
CHANGED
|
@@ -29,6 +29,18 @@ def is_admin() -> bool:
|
|
|
29
29
|
return result
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
def get_ubuntu_sudo_executer_username() -> str:
|
|
33
|
+
"""
|
|
34
|
+
Function gets the username of the user who executed the script with sudo.
|
|
35
|
+
:return: str, username.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
if 'SUDO_USER' in os.environ:
|
|
39
|
+
return os.environ['SUDO_USER']
|
|
40
|
+
else:
|
|
41
|
+
return ''
|
|
42
|
+
|
|
43
|
+
|
|
32
44
|
def set_executable_permission(file_path: str):
|
|
33
45
|
"""
|
|
34
46
|
Function sets the executable permission on a file.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import subprocess
|
|
2
2
|
import getpass
|
|
3
3
|
|
|
4
|
-
from ... import process, filesystem
|
|
4
|
+
from ... import process, filesystem, permissions
|
|
5
5
|
from ...print_api import print_api
|
|
6
6
|
|
|
7
7
|
|
|
@@ -67,14 +67,23 @@ def install_docker_ubuntu():
|
|
|
67
67
|
# sudo docker run hello-world
|
|
68
68
|
|
|
69
69
|
# Add Privileges to run docker without sudo. Add current user to Docker superuser group.
|
|
70
|
-
sudo usermod -aG docker $USER
|
|
70
|
+
# sudo usermod -aG docker $USER
|
|
71
71
|
"""
|
|
72
72
|
|
|
73
73
|
process.execute_script(script, shell=True)
|
|
74
74
|
|
|
75
|
+
# Check if current user that executed the script is a sudo user. If not, use the current user.
|
|
76
|
+
sudo_executer_username: str = permissions.get_ubuntu_sudo_executer_username()
|
|
77
|
+
if sudo_executer_username:
|
|
78
|
+
current_user = sudo_executer_username
|
|
79
|
+
else:
|
|
80
|
+
current_user = getpass.getuser()
|
|
81
|
+
|
|
75
82
|
# Add the current user to the docker group.
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
# subprocess.check_call(['sudo', 'usermod', '-aG', 'docker', current_user])
|
|
84
|
+
command = f"sudo usermod -aG docker {current_user}"
|
|
85
|
+
# Execute the command
|
|
86
|
+
subprocess.run(command, shell=True, capture_output=True, text=True)
|
|
78
87
|
|
|
79
88
|
# Verify the installation.
|
|
80
89
|
result: list = process.execute_with_live_output('sudo docker run hello-world')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=AI9-pSv-wHAVsqcfmuGziP6-kJEuPUTy9Hf2ngGpdYI,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
|
|
@@ -22,7 +22,7 @@ atomicshop/inspect_wrapper.py,sha256=sGRVQhrJovNygHTydqJj0hxES-aB2Eg9KbIk3G31apw
|
|
|
22
22
|
atomicshop/ip_addresses.py,sha256=Hvi4TumEFoTEpKWaq5WNF-YzcRzt24IxmNgv-Mgax1s,1190
|
|
23
23
|
atomicshop/keyboard_press.py,sha256=1W5kRtOB75fulVx-uF2yarBhW0_IzdI1k73AnvXstk0,452
|
|
24
24
|
atomicshop/pbtkmultifile_argparse.py,sha256=aEk8nhvoQVu-xyfZosK3ma17CwIgOjzO1erXXdjwtS4,4574
|
|
25
|
-
atomicshop/permissions.py,sha256=
|
|
25
|
+
atomicshop/permissions.py,sha256=y63kcxU6GAmnVXqWhs_N29XorOD2xYWlK_CjZ1PpHgA,2897
|
|
26
26
|
atomicshop/print_api.py,sha256=DhbCQd0MWZZ5GYEk4oTu1opRFC-b31g1VWZgTGewG2Y,11568
|
|
27
27
|
atomicshop/process.py,sha256=SXaqG8pzNkHvppPhuhixEIXSaqbeDlTUFLaS5bYSp54,14176
|
|
28
28
|
atomicshop/process_name_cmd.py,sha256=TNAK6kQZm5JKWzEW6QLqVHEG98ZLNDQiSS4YwDk8V8c,3830
|
|
@@ -154,7 +154,7 @@ atomicshop/wrappers/certauthw/certauthw.py,sha256=4WvhjANI7Kzqrr_nKmtA8Kf7B6rute
|
|
|
154
154
|
atomicshop/wrappers/ctyping/process_winapi.py,sha256=QcXL-ETtlSSkoT8F7pYle97ubGWsjYp8cx8HxkVMgAc,2762
|
|
155
155
|
atomicshop/wrappers/dockerw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
156
156
|
atomicshop/wrappers/dockerw/dockerw.py,sha256=w8zSJr5C7cbvbuG09ORCpAe0BOcibqqL_Z2EKEBHYK4,6266
|
|
157
|
-
atomicshop/wrappers/dockerw/install_docker.py,sha256=
|
|
157
|
+
atomicshop/wrappers/dockerw/install_docker.py,sha256=RyrYCHoRexzPjtBK9Qz1apWrbKLAI3DKOfJRztZFIMY,3629
|
|
158
158
|
atomicshop/wrappers/elasticsearchw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
159
159
|
atomicshop/wrappers/elasticsearchw/config_basic.py,sha256=XJMKKfDrUq9ZKxYnQ-xFJxSA51z31Nn4eB8_n_hryVk,800
|
|
160
160
|
atomicshop/wrappers/elasticsearchw/elasticsearchw.py,sha256=7TqFdEFznO8NlligJhEKk1vm641ALpCYdaRl1uoXdzM,9768
|
|
@@ -230,8 +230,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
|
|
|
230
230
|
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
|
|
231
231
|
atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
|
|
232
232
|
atomicshop/wrappers/socketw/statistics_csv.py,sha256=t3dtDEfN47CfYVi0CW6Kc2QHTEeZVyYhc57IYYh5nmA,826
|
|
233
|
-
atomicshop-2.9.
|
|
234
|
-
atomicshop-2.9.
|
|
235
|
-
atomicshop-2.9.
|
|
236
|
-
atomicshop-2.9.
|
|
237
|
-
atomicshop-2.9.
|
|
233
|
+
atomicshop-2.9.28.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
234
|
+
atomicshop-2.9.28.dist-info/METADATA,sha256=3VX-U9jIYQ5eLrRA5A1Xlfieud8DJlHNYnZj4l2U8e8,10423
|
|
235
|
+
atomicshop-2.9.28.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
236
|
+
atomicshop-2.9.28.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
237
|
+
atomicshop-2.9.28.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|