atomicshop 2.9.30__py3-none-any.whl → 2.9.32__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/filesystem.py +23 -4
- atomicshop/wrappers/dockerw/install_docker.py +2 -1
- atomicshop/wrappers/factw/install/pre_install_and_install_before_restart.py +1 -1
- atomicshop/wrappers/nodejsw/__init__.py +0 -0
- atomicshop/wrappers/nodejsw/install_nodejs.py +49 -0
- {atomicshop-2.9.30.dist-info → atomicshop-2.9.32.dist-info}/METADATA +1 -1
- {atomicshop-2.9.30.dist-info → atomicshop-2.9.32.dist-info}/RECORD +11 -9
- {atomicshop-2.9.30.dist-info → atomicshop-2.9.32.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.9.30.dist-info → atomicshop-2.9.32.dist-info}/WHEEL +0 -0
- {atomicshop-2.9.30.dist-info → atomicshop-2.9.32.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/filesystem.py
CHANGED
|
@@ -61,14 +61,33 @@ FILE_NAME_REPLACEMENT_DICT: dict = {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
def
|
|
64
|
+
def get_home_directory(return_sudo_user: bool = False) -> str:
|
|
65
65
|
"""
|
|
66
|
-
|
|
66
|
+
Returns the home directory of the current user or the user who invoked sudo.
|
|
67
67
|
|
|
68
|
-
:
|
|
68
|
+
:param return_sudo_user: bool, if 'False', then the function will return the home directory of the user who invoked
|
|
69
|
+
sudo (if the script was invoked with sudo).
|
|
70
|
+
If 'True', then the function will return the home directory of the current user, doesn't matter if the script was
|
|
71
|
+
invoked with sudo or not, if so home directory of the sudo user will be returned.
|
|
69
72
|
"""
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
def return_home_directory_of_current_user():
|
|
75
|
+
"""
|
|
76
|
+
Returns the home directory of the current user.
|
|
77
|
+
"""
|
|
78
|
+
return os.path.expanduser('~')
|
|
79
|
+
|
|
80
|
+
# Check if the script is run using sudo
|
|
81
|
+
if 'SUDO_USER' in os.environ:
|
|
82
|
+
# If 'return_sudo_user' is set to 'True', return the home directory of the sudo user.
|
|
83
|
+
if return_sudo_user:
|
|
84
|
+
return_home_directory_of_current_user()
|
|
85
|
+
else:
|
|
86
|
+
# Get the home directory of the user who invoked sudo
|
|
87
|
+
return os.path.expanduser(f"~{os.environ['SUDO_USER']}")
|
|
88
|
+
|
|
89
|
+
# Get the current user's home directory
|
|
90
|
+
return_home_directory_of_current_user()
|
|
72
91
|
|
|
73
92
|
|
|
74
93
|
def create_empty_file(file_path: str) -> None:
|
|
@@ -54,7 +54,8 @@ def add_current_user_to_docker_group(print_kwargs: dict = None):
|
|
|
54
54
|
print_api(f"User {current_user} was added to the docker group.", color='green', **(print_kwargs or {}))
|
|
55
55
|
return True
|
|
56
56
|
else:
|
|
57
|
-
print_api(f"User {current_user} was not added to the docker group.", color='red',
|
|
57
|
+
print_api(f"User {current_user} was not added to the docker group. Try executing with sudo", color='red',
|
|
58
|
+
**(print_kwargs or {}))
|
|
58
59
|
return False
|
|
59
60
|
|
|
60
61
|
|
|
@@ -22,7 +22,7 @@ def install_before_restart(installation_directory: str, remove_existing_installa
|
|
|
22
22
|
|
|
23
23
|
if not permissions.is_admin():
|
|
24
24
|
print_api("This script requires root privileges...", color='red')
|
|
25
|
-
|
|
25
|
+
sys.exit(1)
|
|
26
26
|
|
|
27
27
|
docker_keyring_file_path: str = "/etc/apt/keyrings/docker.gpg"
|
|
28
28
|
nodesource_keyring_file_path: str = "/etc/apt/keyrings/nodesource.gpg"
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
import getpass
|
|
3
|
+
|
|
4
|
+
from ... import process, filesystem, permissions
|
|
5
|
+
from ...print_api import print_api
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def is_nodejs_installed():
|
|
9
|
+
"""
|
|
10
|
+
The function will check if Node.js is installed.
|
|
11
|
+
:return: bool.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
# Run the command 'node -v'
|
|
16
|
+
result = subprocess.run(['node', '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
|
17
|
+
|
|
18
|
+
# Check if the command was successful
|
|
19
|
+
if result.returncode == 0:
|
|
20
|
+
message = f"Node.js installed. Version: {result.stdout.strip()}"
|
|
21
|
+
print_api(message, color='green')
|
|
22
|
+
return True
|
|
23
|
+
else:
|
|
24
|
+
print_api("Node.js is not installed.")
|
|
25
|
+
return False
|
|
26
|
+
except FileNotFoundError:
|
|
27
|
+
print_api("Node command not found. Node.js is not installed.")
|
|
28
|
+
return False
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def install_nodejs_ubuntu():
|
|
32
|
+
"""
|
|
33
|
+
The function will install Node.js on Ubuntu.
|
|
34
|
+
:return:
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
# Check if Node.js is already installed.
|
|
38
|
+
if is_nodejs_installed():
|
|
39
|
+
return
|
|
40
|
+
|
|
41
|
+
# Add the Node.js repository.
|
|
42
|
+
process.run_command(['curl', '-sL', 'https://deb.nodesource.com/setup_14.x', '-o', '/tmp/nodesource_setup.sh'])
|
|
43
|
+
process.run_command(['bash', '/tmp/nodesource_setup.sh'])
|
|
44
|
+
|
|
45
|
+
# Install Node.js
|
|
46
|
+
process.run_command(['apt-get', 'install', '-y', 'nodejs'])
|
|
47
|
+
|
|
48
|
+
# Check if Node.js is installed.
|
|
49
|
+
is_nodejs_installed()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=CErizcsVuHKE_YMi9s_wJkMRg-WykjsEKZGiSC7sjIs,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
|
|
@@ -14,7 +14,7 @@ atomicshop/dns.py,sha256=bNZOo5jVPzq7OT2qCPukXoK3zb1oOsyaelUwQEyK1SA,2500
|
|
|
14
14
|
atomicshop/domains.py,sha256=Rxu6JhhMqFZRcoFs69IoEd1PtYca0lMCG6F1AomP7z4,3197
|
|
15
15
|
atomicshop/emails.py,sha256=I0KyODQpIMEsNRi9YWSOL8EUPBiWyon3HRdIuSj3AEU,1410
|
|
16
16
|
atomicshop/file_types.py,sha256=-0jzQMRlmU1AP9DARjk-HJm1tVE22E6ngP2mRblyEjY,763
|
|
17
|
-
atomicshop/filesystem.py,sha256=
|
|
17
|
+
atomicshop/filesystem.py,sha256=yl6_uDd6f6-oXjL1QQ4RHUdIU-GBP3N8sTTPqqKTnxU,43806
|
|
18
18
|
atomicshop/functions.py,sha256=pK8hoCE9z61PtWCxQJsda7YAphrLH1wxU5x-1QJP-sY,499
|
|
19
19
|
atomicshop/hashing.py,sha256=Le8qGFyt3_wX-zGTeQShz7L2HL_b6nVv9PnawjglyHo,3474
|
|
20
20
|
atomicshop/http_parse.py,sha256=nrf2rZcprLqtW8HVrV7TCZ1iTBcWRRy-mXIlAOzcaJs,9703
|
|
@@ -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=eF0raR1EO9Xk1MVH7CvtkFI2Fgu9zL12MIYV_1vPTQk,4799
|
|
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
|
|
@@ -177,7 +177,7 @@ atomicshop/wrappers/factw/fact_extractor/docker_image.py,sha256=jJAoJNQ4aoATjn3x
|
|
|
177
177
|
atomicshop/wrappers/factw/fact_extractor/get_extractor.py,sha256=2mfOAftHIlCcGt1s7MWdq7DsDCuI6wX3MtvcEZ4SK-0,756
|
|
178
178
|
atomicshop/wrappers/factw/install/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
179
179
|
atomicshop/wrappers/factw/install/install_after_restart.py,sha256=roM1W2hkDynpEKda55xd7AsZxodsFj8i4wmFGt_HHzA,1558
|
|
180
|
-
atomicshop/wrappers/factw/install/pre_install_and_install_before_restart.py,sha256=
|
|
180
|
+
atomicshop/wrappers/factw/install/pre_install_and_install_before_restart.py,sha256=xPMYgXoyA7y1MHyG5paoqKTWuklhsSGym2ObPcex75M,3036
|
|
181
181
|
atomicshop/wrappers/factw/postgresql/__init__.py,sha256=xMBn2d3Exo23IPP2F_9-SXmOlhFbwWDgS9KwozSTjA0,162
|
|
182
182
|
atomicshop/wrappers/factw/postgresql/analysis.py,sha256=2Rxzy2jyq3zEKIo53z8VkjuslKE_i5mq2ZpmJAvyd6U,716
|
|
183
183
|
atomicshop/wrappers/factw/postgresql/file_object.py,sha256=VRiCXnsd6yDbnsE-TEKYPC-gkAgFVkE6rygRrJLQShI,713
|
|
@@ -198,6 +198,8 @@ atomicshop/wrappers/loggingw/handlers.py,sha256=qm5Fbu8eDmlstMduUe5nKUlJU5IazFkS
|
|
|
198
198
|
atomicshop/wrappers/loggingw/loggers.py,sha256=DHOOTAtqkwn1xgvLHSkOiBm6yFGNuQy1kvbhG-TDog8,2374
|
|
199
199
|
atomicshop/wrappers/loggingw/loggingw.py,sha256=v9WAseZXB50LluT9rIUcRvvevg2nLVKPgz3dbGejfV0,12151
|
|
200
200
|
atomicshop/wrappers/loggingw/reading.py,sha256=xs7L6Jo-vedrhCVP7m-cJo0VhWmoSoK86avR4Tm0kG4,3675
|
|
201
|
+
atomicshop/wrappers/nodejsw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
202
|
+
atomicshop/wrappers/nodejsw/install_nodejs.py,sha256=an7zX_sEG4CF57tdeR3jldDSNnS8Z4vRfSY9y1OjF4g,1440
|
|
201
203
|
atomicshop/wrappers/playwrightw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
202
204
|
atomicshop/wrappers/playwrightw/_tryouts.py,sha256=l1BLkFsiIMNlgv7nfZd1XGEvXQkIQkIcg48__9OaC00,4920
|
|
203
205
|
atomicshop/wrappers/playwrightw/base.py,sha256=WeRpx8otdXuKSr-BjY-uCJTze21kbPpfitoOjKQz5-g,9818
|
|
@@ -230,8 +232,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
|
|
|
230
232
|
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
|
|
231
233
|
atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
|
|
232
234
|
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.
|
|
235
|
+
atomicshop-2.9.32.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
236
|
+
atomicshop-2.9.32.dist-info/METADATA,sha256=TT3Wyxuq7Cqk03IMu7Xut2KwfJz6UscELqCu9OF9FPQ,10423
|
|
237
|
+
atomicshop-2.9.32.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
238
|
+
atomicshop-2.9.32.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
239
|
+
atomicshop-2.9.32.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|