atomicshop 3.1.2__py3-none-any.whl → 3.1.4__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__ = '3.1.2'
4
+ __version__ = '3.1.4'
@@ -66,8 +66,9 @@ class GoogleLLM:
66
66
  number_of_top_links: int = 2,
67
67
  number_of_characters_per_link: int = 15000,
68
68
  temperature: float = 0,
69
- max_output_tokens: int = 4096,
70
- model_name: str = 'gemini-2.0-flash-thinking-exp-01-21'
69
+ # max_output_tokens: int = 4096,
70
+ # model_name: str = 'gemini-2.0-flash-thinking-exp-01-21'
71
+ model_name: str = 'models/gemini-2.5-pro-preview-03-25'
71
72
  ) -> str:
72
73
  """
73
74
  Function to get the answer to a question by searching Google Custom Console API and processing the content using Gemini API.
@@ -121,7 +122,8 @@ class GoogleLLM:
121
122
  f'{combined_content}')
122
123
 
123
124
  # Ask Gemini to process the combined content
124
- gemini_response = self.ask_gemini(final_question, temperature, max_output_tokens, model_name)
125
+ # gemini_response = self.ask_gemini(final_question, temperature, max_output_tokens, model_name)
126
+ gemini_response = self.ask_gemini(final_question, temperature, model_name)
125
127
  return gemini_response
126
128
 
127
129
  @staticmethod
@@ -172,16 +172,6 @@ def add_execution_permissions_for_file(image_id_or_name: str, file_path: str, pr
172
172
 
173
173
 
174
174
  def stop_remove_containers_by_image_name(image_name: str):
175
- def stop_remove_container(container: Container):
176
- """
177
- Stop and remove a container.
178
- :param container: Container, the docker container object.
179
- :return:
180
- """
181
- if container.status == "running":
182
- print_api(f"Stopping container: [{container.name}]. Short ID: [{container.short_id}]")
183
- container.stop()
184
- container.remove()
185
175
  """
186
176
  Remove all containers by image name.
187
177
  :param image_name: str, the name of the image.
@@ -189,8 +179,8 @@ def stop_remove_containers_by_image_name(image_name: str):
189
179
  """
190
180
  client = docker.from_env()
191
181
  all_containers = client.containers.list(all=True)
192
- for current_container in all_containers:
193
- if any(image_name in tag for tag in current_container.image.tags):
182
+ for container in all_containers:
183
+ if any(image_name in tag for tag in container.image.tags):
194
184
  if container.status == "running":
195
185
  print_api(f"Stopping container: [{container.name}]. Short ID: [{container.short_id}]")
196
186
  container.stop()
@@ -241,7 +231,7 @@ def start_container_without_stop(
241
231
  return client, container
242
232
 
243
233
 
244
- def run_command_in_running_container(container: Container, command: list) -> tuple[int, str]:
234
+ def run_command_in_running_container(container: Container, command: list) -> tuple[int, bytes, str]:
245
235
  """
246
236
  Run a command in a running container.
247
237
  :param container: Container, the docker container object.
@@ -250,8 +240,22 @@ def run_command_in_running_container(container: Container, command: list) -> tup
250
240
  """
251
241
 
252
242
  # Run the command inside the already running container
253
- status_code, output_bytes = container.exec_run(cmd=command, stdout=True, stderr=True)
243
+ exec_result = container.exec_run(cmd=command, stdout=True, stderr=True)
254
244
  # Capture logs
255
- output_text = output_bytes.decode("utf-8", errors="replace")
256
-
257
- return status_code, output_text
245
+ output_text = exec_result.output.decode("utf-8", errors="replace")
246
+ execution_result_message: str = str()
247
+ if output_text:
248
+ execution_result_message = f"Container execution result:\n{output_text}"
249
+
250
+ if exec_result.exit_code != 0:
251
+ # logging.warning(f"Extraction command returned code {exec_result.exit_code} for '{filename}'")
252
+ code_message = f"Extraction command returned code {exec_result.exit_code}"
253
+ else:
254
+ code_message = "Extraction succeeded"
255
+
256
+ if execution_result_message:
257
+ execution_result_message += f"\n{code_message}"
258
+ else:
259
+ execution_result_message = code_message
260
+
261
+ return exec_result.exit_code, exec_result.output, execution_result_message
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 3.1.2
3
+ Version: 3.1.4
4
4
  Summary: Atomic functions and classes to make developer life easier
5
5
  Author: Denis Kras
6
6
  License: MIT License
@@ -1,4 +1,4 @@
1
- atomicshop/__init__.py,sha256=9FkiqXkoIc84EfZfIhFK47xqfKhRhJsieqicu4tjeJE,122
1
+ atomicshop/__init__.py,sha256=9-xFtR4CZMUytv4s7xSLB71ElNOa9hz00EgvneY_IqE,122
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
@@ -189,7 +189,7 @@ atomicshop/startup/win/startup_folder.py,sha256=2RZEyF-Mf8eWPlt_-OaoGKKnMs6YhELE
189
189
  atomicshop/startup/win/task_scheduler.py,sha256=qALe-8sfthYxsdCViH2r8OsH3x-WauDqteg5RzElPdk,4348
190
190
  atomicshop/web_apis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
191
191
  atomicshop/web_apis/google_custom_search.py,sha256=R1BnUmBFWZIWkfizSRWoSYoZTdPEjLJ28F_sS2g1jGQ,1558
192
- atomicshop/web_apis/google_llm.py,sha256=bOE91hGSz4I2DJK0LZHMCSDDYSTgP6SF_FWVvpV5LcY,7691
192
+ atomicshop/web_apis/google_llm.py,sha256=_uBu8iKBMEMeJEOOztQiVa7k2yHdrLB81rub8yCuxPI,7850
193
193
  atomicshop/wrappers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
194
194
  atomicshop/wrappers/_process_wrapper_curl.py,sha256=XkZZXYl7D0Q6UfdWqy-18AvpU0yVp9i2BVD2qRcXlkk,841
195
195
  atomicshop/wrappers/_process_wrapper_tar.py,sha256=WUMZFKNrlG4nJP9tWZ51W7BR1j_pIjsjgyAStmWjRGs,655
@@ -223,7 +223,7 @@ atomicshop/wrappers/ctyping/msi_windows_installer/cabs.py,sha256=htzwb2ROYI8yyc8
223
223
  atomicshop/wrappers/ctyping/msi_windows_installer/extract_msi_main.py,sha256=AEkjnqEhfCbCUcYaulv3uba5hZjTB03xm-puAINsZGM,5488
224
224
  atomicshop/wrappers/ctyping/msi_windows_installer/tables.py,sha256=tHsu0YfBgzuIk9L-PyqLgU_IzyVbCfy8L1EqelNnvWk,17674
225
225
  atomicshop/wrappers/dockerw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
226
- atomicshop/wrappers/dockerw/dockerw.py,sha256=cVLUiMetBDlvFVNnX9wzVsUO1ylJxQfEwEw8FOEg37w,9659
226
+ atomicshop/wrappers/dockerw/dockerw.py,sha256=mwQT8d1aUrn8FbMCwcmUjoP35UWexl8DztNSuJAHJQo,9865
227
227
  atomicshop/wrappers/dockerw/install_docker.py,sha256=7NTMxCPBesr0QcqB0RZ5YU0I8FDPtNux_mYAX28wI0I,9982
228
228
  atomicshop/wrappers/elasticsearchw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
229
229
  atomicshop/wrappers/elasticsearchw/config_basic.py,sha256=fDujtrjEjbWiYh_WQ3OcYp_8mXhXPYeKLy4wSPL5qM0,1177
@@ -336,8 +336,8 @@ atomicshop/wrappers/socketw/statistics_csv.py,sha256=WcNyaqEZ82S5-f3kzqi1nllNT2N
336
336
  atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
337
337
  atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
338
338
  atomicshop/wrappers/winregw/winreg_network.py,sha256=3Ts1sVqSUiCDsHRHwJCbiZ9EYvv2ELGxF0Y_pibGU4k,9596
339
- atomicshop-3.1.2.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
340
- atomicshop-3.1.2.dist-info/METADATA,sha256=3K-v2aK-rRo1shq8oR83WC2o6im2elEruEBAgdXDjb4,10653
341
- atomicshop-3.1.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
342
- atomicshop-3.1.2.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
343
- atomicshop-3.1.2.dist-info/RECORD,,
339
+ atomicshop-3.1.4.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
340
+ atomicshop-3.1.4.dist-info/METADATA,sha256=OzJZl-P3897NdQPGhj4UKBbYKCQITS87eJIAt6WWa7E,10653
341
+ atomicshop-3.1.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
342
+ atomicshop-3.1.4.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
343
+ atomicshop-3.1.4.dist-info/RECORD,,