atomicshop 2.19.5__py3-none-any.whl → 2.19.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.19.5'
4
+ __version__ = '2.19.6'
@@ -16,7 +16,12 @@ def main():
16
16
  print_api("Please run this script as an Administrator.", color="red")
17
17
  return 1
18
18
 
19
- install_nodejs_windows.install_nodejs_windows()
19
+ if not install_nodejs_windows.is_nodejs_installed():
20
+ install_nodejs_windows.install_nodejs_windows()
21
+ install_nodejs_windows.add_nodejs_to_path()
22
+ if not install_nodejs_windows.is_nodejs_installed():
23
+ print_api("Node.js installation failed.")
24
+ return 1
20
25
 
21
26
  print_api("PIP Installing Robocorp.")
22
27
  subprocess.check_call(["pip", "install", "--upgrade", "rpaframework"])
@@ -1,3 +1,4 @@
1
+ import subprocess
1
2
  import os
2
3
  import requests
3
4
  import time
@@ -28,6 +29,58 @@ class NodeJSWindowsInstallerFailedToExtractVersionInString(Exception):
28
29
  pass
29
30
 
30
31
 
32
+ def is_nodejs_installed():
33
+ """
34
+ Check if Node.js is installed by trying to run 'node -v'.
35
+ """
36
+ print_api("Checking if Node.js is installed...")
37
+ try:
38
+ try:
39
+ node_version = subprocess.check_output(["node", "-v"], text=True)
40
+ except FileNotFoundError:
41
+ print_api(f"node.exe is not found.", color="red")
42
+ raise
43
+
44
+ node_version = node_version.replace("\n", "")
45
+ print_api(f"node.exe is found. Version: {node_version}", color="green")
46
+
47
+ try:
48
+ npm_version = subprocess.check_output(["npm.cmd", "-v"], text=True).strip()
49
+ except FileNotFoundError:
50
+ print_api(f"npm.cmd is not found.", color="red")
51
+ raise
52
+
53
+ npm_version = npm_version.replace("\n", "")
54
+ print_api(f"npm.cmd is found. Version: {npm_version}", color="green")
55
+ print_api("Node.js is installed.")
56
+ return True
57
+ except FileNotFoundError:
58
+ print_api("Node.js is not installed.")
59
+ return False
60
+
61
+
62
+ def add_nodejs_to_path():
63
+ """
64
+ Add Node.js to the PATH for the current CMD session.
65
+ """
66
+ print_api("Adding Node.js to the PATH for the current session...")
67
+ # Get the installation directory from the default Node.js install path
68
+ program_files = os.environ.get("ProgramFiles", "C:\\Program Files")
69
+ nodejs_path = os.path.join(program_files, "nodejs")
70
+
71
+ if os.path.exists(nodejs_path):
72
+ print_api(f"Node.js installation found at: {nodejs_path}")
73
+ current_path = os.environ.get("PATH", "")
74
+ if nodejs_path not in current_path:
75
+ # Add Node.js to the PATH for the current process
76
+ os.environ["PATH"] = f"{nodejs_path};{current_path}"
77
+ print_api("Node.js has been added to the PATH for this session.")
78
+ else:
79
+ print_api("Node.js is already in the PATH.")
80
+ else:
81
+ print_api("Node.js installation directory not found.")
82
+
83
+
31
84
  def get_latest_nodejs_version():
32
85
  """
33
86
  Fetch the latest Node.js version from the official Node.js website.
@@ -93,6 +146,18 @@ def clean_up(installer_path):
93
146
 
94
147
 
95
148
  def install_nodejs_windows() -> int:
149
+ """
150
+ Install Node.js on Windows.
151
+ If you're installing as part of a cmd script that continues and installs npm packages, you can do something like this:
152
+ if not install_nodejs_windows.is_nodejs_installed():
153
+ install_nodejs_windows.is_nodejs_installed()
154
+ install_nodejs_windows.install_nodejs_windows()
155
+ install_nodejs_windows.add_nodejs_to_path()
156
+ if not install_nodejs_windows.is_nodejs_installed():
157
+ print_api("Node.js installation failed.")
158
+ return 1
159
+ :return:
160
+ """
96
161
  if not permissions.is_admin():
97
162
  print_api("This script requires administrative privileges to install Node.js.")
98
163
  return 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.19.5
3
+ Version: 2.19.6
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=HqJjN2U9eg60cXrH3gI048pmphyRdHtu6prGubLOP9Q,123
1
+ atomicshop/__init__.py,sha256=knCj__YmUuoKs1yCpFlwbRugLxYK9EFx2UTKQEkbSTc,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
@@ -57,7 +57,7 @@ atomicshop/a_installs/win/fibratus.py,sha256=TU4e9gdZ_zI73C40uueJ59pD3qmN-UFGdX5
57
57
  atomicshop/a_installs/win/mongodb.py,sha256=AqyItXu19aaoe49pppDxtEkXey6PMy0PoT2Y_RmPpPE,179
58
58
  atomicshop/a_installs/win/nodejs.py,sha256=U519Dyt4bsQPbEg_PwnZL5tsbfqDr1BbhxwoQFZsSKo,200
59
59
  atomicshop/a_installs/win/pycharm.py,sha256=j_RSd7aDOyC3yDd-_GUTMLlQTmDrqtVFG--oUfGLiZk,140
60
- atomicshop/a_installs/win/robocorp.py,sha256=K5Y6Irniq_f56Lzacztna-348iJBpXwufMpds3gFaXk,1894
60
+ atomicshop/a_installs/win/robocorp.py,sha256=tCUrBHFynAZK81To8vRBvchOwY6BWc4LhBgTxXb0az4,2132
61
61
  atomicshop/a_installs/win/wsl_ubuntu_lts.py,sha256=dZbPRLNKFeMd6MotjkE6UDY9cOiIaaclIdR1kGYWI50,139
62
62
  atomicshop/a_mains/dns_gateway_setting.py,sha256=ncc2rFQCChxlNP59UshwmTonLqC6MWblrVAzbbz-13M,149
63
63
  atomicshop/a_mains/msi_unpacker.py,sha256=5hrkqETYt9HIqR_3PMf32_q06kCrIcsdm_RJV9oY438,188
@@ -269,7 +269,7 @@ atomicshop/wrappers/mongodbw/mongo_infra.py,sha256=IjEF0jPzQz866MpTm7rnksnyyWQeU
269
269
  atomicshop/wrappers/mongodbw/mongodbw.py,sha256=ih3Gd45rg_70y4sGeu0eEJ3sJd9tEN4I5IqHZelRZJw,52854
270
270
  atomicshop/wrappers/nodejsw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
271
271
  atomicshop/wrappers/nodejsw/install_nodejs_ubuntu.py,sha256=wjpJdfAaY92RYl_L9esDIWuBMGeYH35RHJ5BVgMof8Y,6260
272
- atomicshop/wrappers/nodejsw/install_nodejs_windows.py,sha256=wZBlhEyg-iYCDir0ces6RXPQTihp96VzTN3OApcd4c8,3716
272
+ atomicshop/wrappers/nodejsw/install_nodejs_windows.py,sha256=WvXIcEVnKcQYD-KNwhVP094s__1tt0Ir2Y87MABl8Nc,6283
273
273
  atomicshop/wrappers/playwrightw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
274
274
  atomicshop/wrappers/playwrightw/_tryouts.py,sha256=l1BLkFsiIMNlgv7nfZd1XGEvXQkIQkIcg48__9OaC00,4920
275
275
  atomicshop/wrappers/playwrightw/base.py,sha256=WeRpx8otdXuKSr-BjY-uCJTze21kbPpfitoOjKQz5-g,9818
@@ -325,8 +325,8 @@ atomicshop/wrappers/socketw/statistics_csv.py,sha256=fgMzDXI0cybwUEqAxprRmY3lqbh
325
325
  atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
326
326
  atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
327
327
  atomicshop/wrappers/winregw/winreg_network.py,sha256=AENV88H1qDidrcpyM9OwEZxX5svfi-Jb4N6FkS1xtqA,8851
328
- atomicshop-2.19.5.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
329
- atomicshop-2.19.5.dist-info/METADATA,sha256=vkTvJ6-xa2PnBQvbzlWF2u7Hk_NBhPKermW9W9izX9A,10630
330
- atomicshop-2.19.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
331
- atomicshop-2.19.5.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
332
- atomicshop-2.19.5.dist-info/RECORD,,
328
+ atomicshop-2.19.6.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
329
+ atomicshop-2.19.6.dist-info/METADATA,sha256=Y0sI9FlA-ojjoCn5MnTdwd1xe6nC1Rs8tVkH9dxtyHo,10630
330
+ atomicshop-2.19.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
331
+ atomicshop-2.19.6.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
332
+ atomicshop-2.19.6.dist-info/RECORD,,