atomicshop 2.6.3__py3-none-any.whl → 2.6.5__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 +22 -0
- atomicshop/wrappers/dockerw/dockerw.py +35 -0
- atomicshop/wrappers/factw/fact_extractor/docker_image.py +8 -1
- {atomicshop-2.6.3.dist-info → atomicshop-2.6.5.dist-info}/METADATA +2 -1
- {atomicshop-2.6.3.dist-info → atomicshop-2.6.5.dist-info}/RECORD +9 -8
- {atomicshop-2.6.3.dist-info → atomicshop-2.6.5.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.6.3.dist-info → atomicshop-2.6.5.dist-info}/WHEEL +0 -0
- {atomicshop-2.6.3.dist-info → atomicshop-2.6.5.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/filesystem.py
CHANGED
|
@@ -59,6 +59,28 @@ FILE_NAME_REPLACEMENT_DICT: dict = {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
|
|
62
|
+
def get_linux_home() -> str:
|
|
63
|
+
"""
|
|
64
|
+
The function will return the home directory of the user on Linux.
|
|
65
|
+
|
|
66
|
+
:return: string, home directory of the user on Linux.
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
return os.path.expanduser('~')
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def create_empty_file(file_path: str) -> None:
|
|
73
|
+
"""
|
|
74
|
+
The function creates an empty file.
|
|
75
|
+
|
|
76
|
+
:param file_path: string, full path to file.
|
|
77
|
+
:return: None.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
# Create empty file.
|
|
81
|
+
Path(file_path).touch()
|
|
82
|
+
|
|
83
|
+
|
|
62
84
|
def get_working_directory() -> str:
|
|
63
85
|
"""
|
|
64
86
|
The function returns working directory of called script file.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import docker
|
|
2
|
+
|
|
3
|
+
from ...print_api import print_api
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def get_images():
|
|
7
|
+
"""
|
|
8
|
+
Show all images in the local registry
|
|
9
|
+
Usages:
|
|
10
|
+
from atomicshop.wrappers.dockerw import dockerw
|
|
11
|
+
images = dockerw.get_images()
|
|
12
|
+
for image in images:
|
|
13
|
+
print(f"ID: {image.id} Tags: {image.tags}")
|
|
14
|
+
"""
|
|
15
|
+
client = docker.from_env()
|
|
16
|
+
images = client.images.list()
|
|
17
|
+
|
|
18
|
+
return images
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def remove_image(image_id_or_tag: str, print_kwargs: dict = None):
|
|
22
|
+
"""
|
|
23
|
+
Remove an image from the local registry by providing the image id or tag.
|
|
24
|
+
:param image_id_or_tag: string, the image id or tag.
|
|
25
|
+
:param print_kwargs: dict, the print arguments.
|
|
26
|
+
:return:
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
if print_kwargs is None:
|
|
30
|
+
print_kwargs = {}
|
|
31
|
+
|
|
32
|
+
client = docker.from_env()
|
|
33
|
+
|
|
34
|
+
client.images.remove(image_id_or_tag)
|
|
35
|
+
print_api(f"Image {image_id_or_tag} removed successfully.", **print_kwargs)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from ....import process
|
|
2
|
-
from ...dockerw import install_docker
|
|
2
|
+
from ...dockerw import install_docker, dockerw
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
def create_docker_image_ubuntu(directory_path: str):
|
|
@@ -31,6 +31,13 @@ def create_docker_image_ubuntu(directory_path: str):
|
|
|
31
31
|
if not install_docker.is_docker_installed():
|
|
32
32
|
install_docker.install_docker_ubuntu()
|
|
33
33
|
|
|
34
|
+
# Remove the image if exists.
|
|
35
|
+
images = dockerw.get_images()
|
|
36
|
+
for image in images:
|
|
37
|
+
# There is also 'fkiecad/fact_extractor:latest' image, which is a part of FACT_core backend.
|
|
38
|
+
if image.tags == ['fact_extractor:latest']:
|
|
39
|
+
dockerw.remove_image(image_id_or_tag=image.id)
|
|
40
|
+
|
|
34
41
|
# Create the script to execute.
|
|
35
42
|
script = f"""
|
|
36
43
|
#!/bin/bash
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: atomicshop
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.5
|
|
4
4
|
Summary: Atomic functions and classes to make developer life easier
|
|
5
5
|
Author: Denis Kras
|
|
6
6
|
License: MIT License
|
|
@@ -36,6 +36,7 @@ Requires-Dist: wheel
|
|
|
36
36
|
Requires-Dist: cryptography
|
|
37
37
|
Requires-Dist: dnslib
|
|
38
38
|
Requires-Dist: dnspython
|
|
39
|
+
Requires-Dist: docker
|
|
39
40
|
Requires-Dist: numpy
|
|
40
41
|
Requires-Dist: openpyxl
|
|
41
42
|
Requires-Dist: pandas
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=DlLqgTSNqdFD_e2ee9wPSD85HhlGPLtBZy23FpnOylY,122
|
|
2
2
|
atomicshop/_basics_temp.py,sha256=6cu2dd6r2dLrd1BRNcVDKTHlsHs_26Gpw8QS6v32lQ0,3699
|
|
3
3
|
atomicshop/_patch_import.py,sha256=ENp55sKVJ0e6-4lBvZnpz9PQCt3Otbur7F6aXDlyje4,6334
|
|
4
4
|
atomicshop/appointment_management.py,sha256=N3wVGJgrqJfsj_lqiRfaL3FxMEe57by5Stzanh189mk,7263
|
|
@@ -13,7 +13,7 @@ atomicshop/diff_check.py,sha256=RON9cSTgy3jAnwUmAUkOyfF6bgrBKOq9Sbgyl3RYodw,1235
|
|
|
13
13
|
atomicshop/dns.py,sha256=bNZOo5jVPzq7OT2qCPukXoK3zb1oOsyaelUwQEyK1SA,2500
|
|
14
14
|
atomicshop/domains.py,sha256=Rxu6JhhMqFZRcoFs69IoEd1PtYca0lMCG6F1AomP7z4,3197
|
|
15
15
|
atomicshop/emails.py,sha256=I0KyODQpIMEsNRi9YWSOL8EUPBiWyon3HRdIuSj3AEU,1410
|
|
16
|
-
atomicshop/filesystem.py,sha256=
|
|
16
|
+
atomicshop/filesystem.py,sha256=ZIVmZ3Zfq4U3gJ7Bta6wPnHSNJMwpyC1CoJcgTDxKUg,32624
|
|
17
17
|
atomicshop/functions.py,sha256=pK8hoCE9z61PtWCxQJsda7YAphrLH1wxU5x-1QJP-sY,499
|
|
18
18
|
atomicshop/hashing.py,sha256=Le8qGFyt3_wX-zGTeQShz7L2HL_b6nVv9PnawjglyHo,3474
|
|
19
19
|
atomicshop/http_parse.py,sha256=nrf2rZcprLqtW8HVrV7TCZ1iTBcWRRy-mXIlAOzcaJs,9703
|
|
@@ -144,13 +144,14 @@ atomicshop/wrappers/certauthw/certauth.py,sha256=hKedW0DOWlEigSNm8wu4SqHkCQsGJ1t
|
|
|
144
144
|
atomicshop/wrappers/certauthw/certauthw.py,sha256=4WvhjANI7Kzqrr_nKmtA8Kf7B6rute_5wfP65gwQrjw,8082
|
|
145
145
|
atomicshop/wrappers/ctyping/process_winapi.py,sha256=QcXL-ETtlSSkoT8F7pYle97ubGWsjYp8cx8HxkVMgAc,2762
|
|
146
146
|
atomicshop/wrappers/dockerw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
147
|
+
atomicshop/wrappers/dockerw/dockerw.py,sha256=cZ0BgdVU43aJYFlhEVvVch4YiD3B_pG5T4zdZpC5Oyc,934
|
|
147
148
|
atomicshop/wrappers/dockerw/install_docker.py,sha256=dpSOmD690oLukoLCo0u6Pzh5fRyCWBuSQEtG8VwC3jk,2765
|
|
148
149
|
atomicshop/wrappers/factw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
149
150
|
atomicshop/wrappers/factw/config_fact.py,sha256=J-K9Zn50WcDC7ubb-boraSZExfBk7a6M52NhRJVlsjk,895
|
|
150
151
|
atomicshop/wrappers/factw/config_install.py,sha256=L_ZftnFkqU9mPZbnbcNoo2gsXBcdhezm-te1A6u3-fE,369
|
|
151
152
|
atomicshop/wrappers/factw/get_file_data.py,sha256=ChKC0OjgjFlNubZQBwcGhRO3L2pccc27RLRlAMIUix4,1641
|
|
152
153
|
atomicshop/wrappers/factw/fact_extractor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
153
|
-
atomicshop/wrappers/factw/fact_extractor/docker_image.py,sha256=
|
|
154
|
+
atomicshop/wrappers/factw/fact_extractor/docker_image.py,sha256=FlGt3LAeFYztb7Ce4H98sQbRa0LB2ijjQa-MMSGLvHc,2402
|
|
154
155
|
atomicshop/wrappers/factw/fact_extractor/get_extractor.py,sha256=2mfOAftHIlCcGt1s7MWdq7DsDCuI6wX3MtvcEZ4SK-0,756
|
|
155
156
|
atomicshop/wrappers/factw/install/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
156
157
|
atomicshop/wrappers/factw/install/install_after_restart.py,sha256=Wixuc-foMA0qGjzypbbQ5sdE-F72yIKmrI9c6xwLY-g,1571
|
|
@@ -203,8 +204,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
|
|
|
203
204
|
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
|
|
204
205
|
atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
|
|
205
206
|
atomicshop/wrappers/socketw/statistics_csv.py,sha256=t3dtDEfN47CfYVi0CW6Kc2QHTEeZVyYhc57IYYh5nmA,826
|
|
206
|
-
atomicshop-2.6.
|
|
207
|
-
atomicshop-2.6.
|
|
208
|
-
atomicshop-2.6.
|
|
209
|
-
atomicshop-2.6.
|
|
210
|
-
atomicshop-2.6.
|
|
207
|
+
atomicshop-2.6.5.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
208
|
+
atomicshop-2.6.5.dist-info/METADATA,sha256=gyhCEJO58Q5NlQA4F-7TxX-tchTzkNGGSBeOQv8idmk,10290
|
|
209
|
+
atomicshop-2.6.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
210
|
+
atomicshop-2.6.5.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
211
|
+
atomicshop-2.6.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|