atomicshop 2.6.4__py3-none-any.whl → 2.6.6__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.6.4'
4
+ __version__ = '2.6.6'
@@ -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,15 @@ 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 are 2 images:
38
+ # 'fkiecad/fact_extractor:latest' - The image that is downloaded.
39
+ # 'fact_extractor:latest' - The image that is built.
40
+ if 'fact_extractor' in image.tags:
41
+ dockerw.remove_image(image_id_or_tag=image.id)
42
+
34
43
  # Create the script to execute.
35
44
  script = f"""
36
45
  #!/bin/bash
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.6.4
3
+ Version: 2.6.6
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=rgcFnkoZb5QOXNED5nID13Ev6vETh2KbA2y_y2S1gmM,122
1
+ atomicshop/__init__.py,sha256=WX9JM9Uv2agGaDi2IHGv_9ZDZdGBXfiGnAqCp6FOovU,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
@@ -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=d2QLX0zTmJubzyvegf_SJK4yT7Ml2Aw_VlCSzZINFVs,2080
154
+ atomicshop/wrappers/factw/fact_extractor/docker_image.py,sha256=4yQuOY4xLltrKfpwLZRUTSmywYcDv2bghcFtvqxNQm4,2459
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.4.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
207
- atomicshop-2.6.4.dist-info/METADATA,sha256=smQDv30aFWsIuv-IZWv8EPcTwtVDwT9zXf2Xl4chI0U,10267
208
- atomicshop-2.6.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
209
- atomicshop-2.6.4.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
210
- atomicshop-2.6.4.dist-info/RECORD,,
207
+ atomicshop-2.6.6.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
208
+ atomicshop-2.6.6.dist-info/METADATA,sha256=L7hiqGzTCJUq9alDq0MI8VUQKE_4UBIxZSJm109IAoY,10290
209
+ atomicshop-2.6.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
210
+ atomicshop-2.6.6.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
211
+ atomicshop-2.6.6.dist-info/RECORD,,