atomicshop 2.18.33__py3-none-any.whl → 2.19.0__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.18.33'
4
+ __version__ = '2.19.0'
@@ -0,0 +1,52 @@
1
+ import sys
2
+ import subprocess
3
+ import tempfile
4
+
5
+ from atomicshop.print_api import print_api
6
+ from atomicshop.wrappers import githubw
7
+ from atomicshop.permissions import permissions
8
+
9
+
10
+ WINDOWS_TESSERACT_DEFAULT_INSTALLATION_DIRECTORY: str = r"C:\Program Files\Tesseract-OCR"
11
+
12
+
13
+ def main():
14
+ if not permissions.is_admin():
15
+ print_api("Please run this script as an Administrator.", color="red")
16
+ return 1
17
+ """
18
+ print_api("PIP Installing Robocorp.")
19
+ subprocess.check_call(["pip", "install", "--upgrade", "rpaframework"])
20
+
21
+ print_api("PIP Installing Robocorp-Browser.")
22
+ subprocess.check_call(["pip", "install", "--upgrade", "robotframework-browser"])
23
+
24
+ print_api("PIP Installing Robocorp-Recognition.")
25
+ subprocess.check_call(["pip", "install", "--upgrade", "rpaframework-recognition"])
26
+
27
+ print_api("Installing Playwright browsers.")
28
+ subprocess.check_call(["playwright", "install"])
29
+
30
+ print_api("Initializing Robocorp Browser.")
31
+ subprocess.check_call(["rfbrowser", "init"])
32
+
33
+ print_api("Installing Tesseract OCR.")
34
+ github_wrapper = githubw.GitHubWrapper(
35
+ user_name="tesseract-ocr",
36
+ repo_name="tesseract",
37
+ branch="main")
38
+ github_wrapper.build_links_from_user_and_repo()
39
+ temp_file_path: str = tempfile.gettempdir()
40
+ tesseract_installer = github_wrapper.download_latest_release(
41
+ target_directory=temp_file_path,
42
+ string_pattern="*tesseract*exe")
43
+
44
+ # The Admin needed to install Tesseract.
45
+ subprocess.check_call([tesseract_installer, "/S"])
46
+ """
47
+ # Add Tesseract to the PATH.
48
+ subprocess.check_call(["setx", "PATH", f"%PATH%;{WINDOWS_TESSERACT_DEFAULT_INSTALLATION_DIRECTORY}"])
49
+
50
+
51
+ if __name__ == '__main__':
52
+ sys.exit(main())
atomicshop/filesystem.py CHANGED
@@ -1743,6 +1743,8 @@ def create_ubuntu_desktop_shortcut(
1743
1743
  raise ValueError("Either 'file_path' or 'command' must be specified.")
1744
1744
  if command and file_path:
1745
1745
  raise ValueError("Only one of 'file_path' or 'command' can be specified.")
1746
+ if command and not shortcut_name:
1747
+ raise ValueError("The 'shortcut_name' must be specified when 'command' is used.")
1746
1748
 
1747
1749
  from .permissions import ubuntu_permissions
1748
1750
 
@@ -1755,6 +1757,13 @@ def create_ubuntu_desktop_shortcut(
1755
1757
  if not shortcut_name:
1756
1758
  shortcut_name: str = Path(file_path).stem
1757
1759
 
1760
+ if command:
1761
+ executable: str = command
1762
+ elif file_path:
1763
+ executable: str = file_path
1764
+ else:
1765
+ raise ValueError("Either 'file_path' or 'command' must be specified.")
1766
+
1758
1767
  # Full path to the .desktop file
1759
1768
  shortcut_path = os.path.join(desktop_dir, f"{shortcut_name}.desktop")
1760
1769
 
@@ -1764,7 +1773,7 @@ def create_ubuntu_desktop_shortcut(
1764
1773
  "Version=1.0",
1765
1774
  "Type=Application",
1766
1775
  f"Name={shortcut_name}",
1767
- f"Exec={file_path}",
1776
+ f"Exec={executable}",
1768
1777
  f"Path={working_directory}" if working_directory else "",
1769
1778
  f"Icon={icon_path}" if icon_path else "",
1770
1779
  f"Terminal={'true' if terminal else 'false'}",
@@ -4,12 +4,6 @@ from dataclasses import dataclass
4
4
  from . import import_config
5
5
 
6
6
 
7
- SCRIPT_VERSION: str = '1.7.8'
8
- """
9
- added ca cert check and installation
10
- """
11
-
12
-
13
7
  # CONFIG = None
14
8
  LIST_OF_BOOLEANS: list = [
15
9
  ('dns', 'enable'),
@@ -59,7 +59,7 @@ def exit_cleanup():
59
59
  RECS_PROCESS_INSTANCE.join()
60
60
 
61
61
 
62
- def mitm_server(config_file_path: str):
62
+ def mitm_server(config_file_path: str, script_version: str):
63
63
  on_exit.register_exit_handler(exit_cleanup, at_exit=False)
64
64
 
65
65
  # Main function should return integer with error code, 0 is successful.
@@ -109,7 +109,7 @@ def mitm_server(config_file_path: str):
109
109
  system_logger.info("======================================")
110
110
  system_logger.info("Server Started.")
111
111
  system_logger.info(f"Python Version: {get_current_python_version_string()}")
112
- system_logger.info(f"Script Version: {config_static.SCRIPT_VERSION}")
112
+ system_logger.info(f"Script Version: {script_version}")
113
113
  system_logger.info(f"Atomic Workshop Version: {atomicshop.__version__}")
114
114
  system_logger.info(f"Log folder: {config_static.LogRec.logs_path}")
115
115
  if config_static.LogRec.enable_request_response_recordings_in_logs:
@@ -411,10 +411,10 @@ def _loop_at_midnight_recs_archive():
411
411
  time.sleep(60)
412
412
 
413
413
 
414
- def mitm_server_main(config_file_path: str):
414
+ def mitm_server_main(config_file_path: str, script_version: str):
415
415
  try:
416
416
  # Main function should return integer with error code, 0 is successful.
417
- return mitm_server(config_file_path)
417
+ return mitm_server(config_file_path, script_version)
418
418
  except KeyboardInterrupt:
419
419
  print_api.print_api("Server Stopped by [KeyboardInterrupt].", color='blue')
420
420
  exit_cleanup()
@@ -3,6 +3,14 @@ import fnmatch
3
3
 
4
4
  from .. import web, urls
5
5
  from ..print_api import print_api
6
+ from ..basics import strings
7
+
8
+
9
+ class MoreThanOneReleaseFoundError(Exception):
10
+ pass
11
+
12
+ class NoReleaseFoundError(Exception):
13
+ pass
6
14
 
7
15
 
8
16
  class GitHubWrapper:
@@ -174,16 +182,19 @@ class GitHubWrapper:
174
182
  download_urls.remove(download_url)
175
183
 
176
184
  # Find urls against 'string_pattern'.
177
- found_urls = fnmatch.filter(download_urls, string_pattern)
185
+ found_urls: list = fnmatch.filter(download_urls, string_pattern)
178
186
 
179
187
  # If more than 1 url answer the criteria, we can't download it. The user must be more specific in his input
180
188
  # strings.
181
189
  if len(found_urls) > 1:
182
190
  message = f'More than 1 result found in JSON response, try changing search string or extension.\n' \
183
191
  f'{found_urls}'
184
- print_api(message, color="red", error_type=True, **kwargs)
185
-
186
- return found_urls[0]
192
+ raise MoreThanOneReleaseFoundError(message)
193
+ elif len(found_urls) == 0:
194
+ message = f'No result found in JSON response, try changing search string or extension.'
195
+ raise NoReleaseFoundError(message)
196
+ else:
197
+ return found_urls[0]
187
198
 
188
199
  def download_latest_release(
189
200
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.18.33
3
+ Version: 2.19.0
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=tl5oB9oZK2xVFfJO_yHvr4Hg8srBxevUD8eq5skKiSo,124
1
+ atomicshop/__init__.py,sha256=OIXYlXkKerHNZWXlxoV3_8FloSrzjYDaCOGsfFfHcjg,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=5Gimq_WY2arqg7BeGmR7P--fGfnH0Dsh8lrOt_H0jRY,6817
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=9ipi8n49r5FZDwE4ZWnT00jAXGostpauzaJotpqdiss,67696
17
+ atomicshop/filesystem.py,sha256=owVG49AtC0-6KCYd3bORwTS44xj4NlfktD70QpIQMrM,68030
18
18
  atomicshop/functions.py,sha256=pK8hoCE9z61PtWCxQJsda7YAphrLH1wxU5x-1QJP-sY,499
19
19
  atomicshop/get_process_list.py,sha256=8cxb7gKe9sl4R6H2yMi8J6oe-RkonTvCdKjRFqi-Fs4,6075
20
20
  atomicshop/get_process_name_cmd_dll.py,sha256=CtaSp3mgxxJKCCVW8BLx6BJNx4giCklU_T7USiCEwfc,5162
@@ -55,6 +55,7 @@ atomicshop/a_installs/ubuntu/pycharm.py,sha256=Ld7YQBwPxrjuZcTG1K4kZqjbBdt8aooCV
55
55
  atomicshop/a_installs/win/fibratus.py,sha256=TU4e9gdZ_zI73C40uueJ59pD3qmN-UFGdX5GFoVf6cM,179
56
56
  atomicshop/a_installs/win/mongodb.py,sha256=AqyItXu19aaoe49pppDxtEkXey6PMy0PoT2Y_RmPpPE,179
57
57
  atomicshop/a_installs/win/pycharm.py,sha256=j_RSd7aDOyC3yDd-_GUTMLlQTmDrqtVFG--oUfGLiZk,140
58
+ atomicshop/a_installs/win/robocorp.py,sha256=sxSqncQIXr4rA8lCr_SwDU18IxWZlNznDE2WY3vPEMM,1789
58
59
  atomicshop/a_installs/win/wsl_ubuntu_lts.py,sha256=dZbPRLNKFeMd6MotjkE6UDY9cOiIaaclIdR1kGYWI50,139
59
60
  atomicshop/a_mains/dns_gateway_setting.py,sha256=ncc2rFQCChxlNP59UshwmTonLqC6MWblrVAzbbz-13M,149
60
61
  atomicshop/a_mains/msi_unpacker.py,sha256=5hrkqETYt9HIqR_3PMf32_q06kCrIcsdm_RJV9oY438,188
@@ -125,13 +126,13 @@ atomicshop/file_io/tomls.py,sha256=ol8EvQPf9sryTmZUf1v55BYSUQ6ml7HVVBHpNKbsIlA,9
125
126
  atomicshop/file_io/xlsxs.py,sha256=v_dyg9GD4LqgWi6wA1QuWRZ8zG4ZwB6Dz52ytdcmmmI,2184
126
127
  atomicshop/file_io/xmls.py,sha256=zh3SuK-dNaFq2NDNhx6ivcf4GYCfGM8M10PcEwDSpxk,2104
127
128
  atomicshop/mitm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
128
- atomicshop/mitm/config_static.py,sha256=HIzxyMEj7DZksYvJsN5VuKpB-_HSVvuR6U59ztS9gi0,7871
129
+ atomicshop/mitm/config_static.py,sha256=DjSnDtMU8srdqca8s6Q-oFCWgjjiCjXRhyk-nafRAUk,7788
129
130
  atomicshop/mitm/config_toml_editor.py,sha256=2p1CMcktWRR_NW-SmyDwylu63ad5e0-w1QPMa8ZLDBw,1635
130
131
  atomicshop/mitm/connection_thread_worker.py,sha256=2180oQgD3qRS53zloeALs_vYt66RJWJtnaCqjl2jVs4,28187
131
132
  atomicshop/mitm/import_config.py,sha256=0Ij14aISTllTOiWYJpIUMOWobQqGofD6uafui5uWllE,9272
132
133
  atomicshop/mitm/initialize_engines.py,sha256=-3B8xkXyPOwrC_mDJm_uaW9s56VeV-f6VTu4-8dou2s,8258
133
134
  atomicshop/mitm/message.py,sha256=mNo4Lphr_Jo6IlNX5mPJzABpogWGkjOhwI4meAivwHw,2987
134
- atomicshop/mitm/mitm_main.py,sha256=Uko4lFG96ZeZ1yVJD5CT4c48NhfX_Hu1g0-THEiZfAc,23454
135
+ atomicshop/mitm/mitm_main.py,sha256=RqRlh5YIY2u817n_L1IUnki6JYXSmr7fTi3bjY5ygRA,23498
135
136
  atomicshop/mitm/recs_files.py,sha256=ZAAD0twun-FtmbSniXe3XQhIlawvANNB_HxwbHj7kwI,3151
136
137
  atomicshop/mitm/shared_functions.py,sha256=0lzeyINd44sVEfFbahJxQmz6KAMWbYrW5ou3UYfItvw,1777
137
138
  atomicshop/mitm/statistic_analyzer.py,sha256=5_sAYGX2Xunzo_pS2W5WijNCwr_BlGJbbOO462y_wN4,27533
@@ -186,7 +187,7 @@ atomicshop/wrappers/astw.py,sha256=VkYfkfyc_PJLIOxByT6L7B8uUmKY6-I8XGZl4t_z828,4
186
187
  atomicshop/wrappers/configparserw.py,sha256=JwDTPjZoSrv44YKwIRcjyUnpN-FjgXVfMqMK_tJuSgU,22800
187
188
  atomicshop/wrappers/cryptographyw.py,sha256=LfzTnwvJE03G6WZryOOf43VKhhnyMakzHpn8DPPCoy4,13252
188
189
  atomicshop/wrappers/ffmpegw.py,sha256=wcq0ZnAe0yajBOuTKZCCaKI7CDBjkq7FAgdW5IsKcVE,6031
189
- atomicshop/wrappers/githubw.py,sha256=gUUVlFnlwKxINXAoK0PTOditEEhe0sWe06aAZ4eQz64,12240
190
+ atomicshop/wrappers/githubw.py,sha256=Ft-QQ4sewzjEWEiW89A_nv9wcKVaQdq76TWvVS6r9mI,12576
190
191
  atomicshop/wrappers/msiw.py,sha256=GQLqud72nfex3kvO1bJSruNriCYTYX1_G1gSf1MPkIA,6118
191
192
  atomicshop/wrappers/numpyw.py,sha256=sBV4gSKyr23kXTalqAb1oqttzE_2XxBooCui66jbAqc,1025
192
193
  atomicshop/wrappers/olefilew.py,sha256=biD5m58rogifCYmYhJBrAFb9O_Bn_spLek_9HofLeYE,2051
@@ -321,8 +322,8 @@ atomicshop/wrappers/socketw/statistics_csv.py,sha256=fgMzDXI0cybwUEqAxprRmY3lqbh
321
322
  atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
322
323
  atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
323
324
  atomicshop/wrappers/winregw/winreg_network.py,sha256=AENV88H1qDidrcpyM9OwEZxX5svfi-Jb4N6FkS1xtqA,8851
324
- atomicshop-2.18.33.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
325
- atomicshop-2.18.33.dist-info/METADATA,sha256=frjR2mXjOWkCdx544wpJDCaxEsCrxmBgF6yjnhhwiAE,10631
326
- atomicshop-2.18.33.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
327
- atomicshop-2.18.33.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
328
- atomicshop-2.18.33.dist-info/RECORD,,
325
+ atomicshop-2.19.0.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
326
+ atomicshop-2.19.0.dist-info/METADATA,sha256=BxY2IEfmMAFhO4teHrr8TYRCzgnf-SsrWaIh_l29YOo,10630
327
+ atomicshop-2.19.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
328
+ atomicshop-2.19.0.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
329
+ atomicshop-2.19.0.dist-info/RECORD,,