atomicshop 2.11.13__py3-none-any.whl → 2.11.15__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/process.py +26 -7
- atomicshop/wrappers/dockerw/install_docker.py +4 -3
- {atomicshop-2.11.13.dist-info → atomicshop-2.11.15.dist-info}/METADATA +1 -1
- {atomicshop-2.11.13.dist-info → atomicshop-2.11.15.dist-info}/RECORD +8 -8
- {atomicshop-2.11.13.dist-info → atomicshop-2.11.15.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.11.13.dist-info → atomicshop-2.11.15.dist-info}/WHEEL +0 -0
- {atomicshop-2.11.13.dist-info → atomicshop-2.11.15.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/process.py
CHANGED
|
@@ -163,7 +163,13 @@ def execute_in_new_window(
|
|
|
163
163
|
return executed_process
|
|
164
164
|
|
|
165
165
|
|
|
166
|
-
def execute_script(
|
|
166
|
+
def execute_script(
|
|
167
|
+
script: str,
|
|
168
|
+
check: bool = True,
|
|
169
|
+
shell: bool = False,
|
|
170
|
+
executable: str = None,
|
|
171
|
+
as_regular_user: bool = False
|
|
172
|
+
):
|
|
167
173
|
"""
|
|
168
174
|
The function executes a batch script bash on Linux or CMD.exe on Windows.
|
|
169
175
|
:param script: string, script to execute.
|
|
@@ -184,15 +190,28 @@ def execute_script(script: str, check: bool = True, shell: bool = False):
|
|
|
184
190
|
'cd' is shell-specific functionality.
|
|
185
191
|
Without shell=True, the Python subprocess module would not understand the command "cd <directory>" as it's
|
|
186
192
|
not an executable but a shell built-in command.
|
|
193
|
+
:param executable: string, the executable that will be used to run the script.
|
|
194
|
+
If not provided, the default shell will be used.
|
|
195
|
+
:param as_regular_user: boolean, if True, the script will be executed as a regular user with:
|
|
196
|
+
'sudo -u <username> <script>'
|
|
197
|
+
but in this context as:
|
|
198
|
+
'sudo -u {os.getlogin()} <script>'
|
|
199
|
+
This is useful when you want to execute a script as a regular user, but you are running the script with sudo.
|
|
200
|
+
Sometimes even if you try to use os.setuid() to change the user, it will not work, since the script is executed
|
|
201
|
+
with sudo.
|
|
187
202
|
:return: None if execution was successful, subprocess.CalledProcessError string if not.
|
|
188
203
|
"""
|
|
189
204
|
|
|
190
|
-
if
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
205
|
+
if not executable:
|
|
206
|
+
if os.name == 'nt':
|
|
207
|
+
executable = 'cmd.exe'
|
|
208
|
+
elif os.name == 'posix':
|
|
209
|
+
executable = '/bin/bash'
|
|
210
|
+
else:
|
|
211
|
+
raise OSError(f'OS not supported: {os.name}')
|
|
212
|
+
|
|
213
|
+
if as_regular_user:
|
|
214
|
+
script = f'sudo -u {os.getlogin()} {script}'
|
|
196
215
|
|
|
197
216
|
try:
|
|
198
217
|
subprocess.run(script, check=check, shell=shell, executable=executable)
|
|
@@ -121,7 +121,7 @@ def install_docker_ubuntu(
|
|
|
121
121
|
sudo apt-get update
|
|
122
122
|
|
|
123
123
|
# Step 2: Install the Docker packages
|
|
124
|
-
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
124
|
+
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
|
|
125
125
|
|
|
126
126
|
# Step 3: Verify the installation
|
|
127
127
|
# sudo docker run hello-world
|
|
@@ -137,8 +137,9 @@ def install_docker_ubuntu(
|
|
|
137
137
|
ubuntu_terminal.update_system_packages()
|
|
138
138
|
ubuntu_terminal.install_packages(['uidmap'])
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
with permissions.temporary_regular_permissions():
|
|
141
|
+
# After 'get-docker.sh' execution, we will install docker in rootless mode.
|
|
142
|
+
process.execute_script('dockerd-rootless-setuptool.sh install', shell=True, as_regular_user=True)
|
|
142
143
|
|
|
143
144
|
# # Start and enable the docker service in user mode.
|
|
144
145
|
# ubuntu_terminal.start_enable_service_check_availability('docker.service', user_mode=True, sudo=False)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=p4rZkHEUyZ2qDBnb8UX0a-oYIUV4-kNCOM3WD1MrZhY,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
|
|
@@ -24,7 +24,7 @@ atomicshop/keyboard_press.py,sha256=1W5kRtOB75fulVx-uF2yarBhW0_IzdI1k73AnvXstk0,
|
|
|
24
24
|
atomicshop/pbtkmultifile_argparse.py,sha256=aEk8nhvoQVu-xyfZosK3ma17CwIgOjzO1erXXdjwtS4,4574
|
|
25
25
|
atomicshop/permissions.py,sha256=y63kcxU6GAmnVXqWhs_N29XorOD2xYWlK_CjZ1PpHgA,2897
|
|
26
26
|
atomicshop/print_api.py,sha256=DhbCQd0MWZZ5GYEk4oTu1opRFC-b31g1VWZgTGewG2Y,11568
|
|
27
|
-
atomicshop/process.py,sha256=
|
|
27
|
+
atomicshop/process.py,sha256=_aDmnQBwpQAD6LO5VPGFFQxkywq5gK7m8N9Z_FHwdDo,15535
|
|
28
28
|
atomicshop/process_name_cmd.py,sha256=TNAK6kQZm5JKWzEW6QLqVHEG98ZLNDQiSS4YwDk8V8c,3830
|
|
29
29
|
atomicshop/process_poller.py,sha256=WfmwCLALfTYOq8ri0vkPeqq8ruEyA_43DaN--CU2_XY,10854
|
|
30
30
|
atomicshop/python_file_patcher.py,sha256=kd3rBWvTcosLEk-7TycNdfKW9fZbe161iVwmH4niUo0,5515
|
|
@@ -164,7 +164,7 @@ atomicshop/wrappers/ctyping/msi_windows_installer/extract_msi_main.py,sha256=eyF
|
|
|
164
164
|
atomicshop/wrappers/ctyping/msi_windows_installer/tables.py,sha256=ajiFiLXl1prg2kOhatfT8E2RKX7F8JjUJpwkVuKu1GY,16263
|
|
165
165
|
atomicshop/wrappers/dockerw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
166
166
|
atomicshop/wrappers/dockerw/dockerw.py,sha256=w8zSJr5C7cbvbuG09ORCpAe0BOcibqqL_Z2EKEBHYK4,6266
|
|
167
|
-
atomicshop/wrappers/dockerw/install_docker.py,sha256=
|
|
167
|
+
atomicshop/wrappers/dockerw/install_docker.py,sha256=U5Akjrs_paZVj4zPGA9gFQAa5NHNeSIKN2iclVszng0,7526
|
|
168
168
|
atomicshop/wrappers/elasticsearchw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
169
169
|
atomicshop/wrappers/elasticsearchw/config_basic.py,sha256=fDujtrjEjbWiYh_WQ3OcYp_8mXhXPYeKLy4wSPL5qM0,1177
|
|
170
170
|
atomicshop/wrappers/elasticsearchw/elasticsearchw.py,sha256=7TqFdEFznO8NlligJhEKk1vm641ALpCYdaRl1uoXdzM,9768
|
|
@@ -242,8 +242,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
|
|
|
242
242
|
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
|
|
243
243
|
atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
|
|
244
244
|
atomicshop/wrappers/socketw/statistics_csv.py,sha256=t3dtDEfN47CfYVi0CW6Kc2QHTEeZVyYhc57IYYh5nmA,826
|
|
245
|
-
atomicshop-2.11.
|
|
246
|
-
atomicshop-2.11.
|
|
247
|
-
atomicshop-2.11.
|
|
248
|
-
atomicshop-2.11.
|
|
249
|
-
atomicshop-2.11.
|
|
245
|
+
atomicshop-2.11.15.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
246
|
+
atomicshop-2.11.15.dist-info/METADATA,sha256=LpgdM2dbstRvFgOAFVd8BMAV_RY8vd3bdTpXYj80JdU,10448
|
|
247
|
+
atomicshop-2.11.15.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
248
|
+
atomicshop-2.11.15.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
249
|
+
atomicshop-2.11.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|