atomicshop 2.12.6__py3-none-any.whl → 2.12.8__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/web.py +11 -3
- atomicshop/wrappers/pycharmw.py +47 -22
- {atomicshop-2.12.6.dist-info → atomicshop-2.12.8.dist-info}/METADATA +3 -2
- {atomicshop-2.12.6.dist-info → atomicshop-2.12.8.dist-info}/RECORD +8 -8
- {atomicshop-2.12.6.dist-info → atomicshop-2.12.8.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.12.6.dist-info → atomicshop-2.12.8.dist-info}/WHEEL +0 -0
- {atomicshop-2.12.6.dist-info → atomicshop-2.12.8.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/web.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import urllib.request
|
|
3
|
+
import ssl
|
|
4
|
+
import certifi
|
|
3
5
|
|
|
4
6
|
from .print_api import print_api
|
|
5
7
|
from .archiver import zips
|
|
@@ -144,12 +146,13 @@ def get_page_content(
|
|
|
144
146
|
return result
|
|
145
147
|
|
|
146
148
|
|
|
147
|
-
def download(file_url: str, target_directory: str, file_name: str = None, **kwargs) -> str:
|
|
149
|
+
def download(file_url: str, target_directory: str = None, file_name: str = None, **kwargs) -> str:
|
|
148
150
|
"""
|
|
149
151
|
The function receives url and target filesystem directory to download the file.
|
|
150
152
|
|
|
151
153
|
:param file_url: full URL to download the file.
|
|
152
154
|
:param target_directory: The directory on the filesystem to save the file to.
|
|
155
|
+
If not specified, temporary directory will be used.
|
|
153
156
|
:param file_name: string, file name (example: file.zip) that you want the downloaded file to be saved as.
|
|
154
157
|
If not specified, the default filename from 'file_url' will be used.
|
|
155
158
|
:return: string, full file path of downloaded file. If download failed, 'None' will be returned.
|
|
@@ -170,6 +173,10 @@ def download(file_url: str, target_directory: str, file_name: str = None, **kwar
|
|
|
170
173
|
# Get only the filename from URL.
|
|
171
174
|
file_name = get_filename_from_url(file_url=file_url)
|
|
172
175
|
|
|
176
|
+
# If 'target_directory' wasn't specified, we will use the temporary directory.
|
|
177
|
+
if not target_directory:
|
|
178
|
+
target_directory = filesystem.get_temp_directory()
|
|
179
|
+
|
|
173
180
|
# Build full path to file.
|
|
174
181
|
file_path: str = f'{target_directory}{os.sep}{file_name}'
|
|
175
182
|
|
|
@@ -177,8 +184,9 @@ def download(file_url: str, target_directory: str, file_name: str = None, **kwar
|
|
|
177
184
|
print_api(f'To: {file_path}', **kwargs)
|
|
178
185
|
|
|
179
186
|
# In order to use 'urllib.request', it is not enough to 'import urllib', you need to 'import urllib.request'.
|
|
180
|
-
# Open the URL for data gathering
|
|
181
|
-
|
|
187
|
+
# Open the URL for data gathering with SSL context from certifi
|
|
188
|
+
ssl_context = ssl.create_default_context(cafile=certifi.where())
|
|
189
|
+
file_to_download = urllib.request.urlopen(file_url, context=ssl_context)
|
|
182
190
|
|
|
183
191
|
# Check status of url.
|
|
184
192
|
if not is_status_ok(status_code=file_to_download.status, **kwargs):
|
atomicshop/wrappers/pycharmw.py
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import requests
|
|
2
|
-
import
|
|
2
|
+
from bs4 import BeautifulSoup
|
|
3
3
|
import subprocess
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
from .. import web, filesystem
|
|
6
|
+
from ..print_api import print_api
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
# URL to the PyCharm Community Edition download page
|
|
8
|
-
PYCHARM_DOWNLOAD_URL = 'https://www.jetbrains.com/pycharm/download
|
|
10
|
+
PYCHARM_DOWNLOAD_URL = 'https://www.jetbrains.com/pycharm/download/#section=windowsC'
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
def download_install_main():
|
|
@@ -27,30 +29,53 @@ def download_install_main():
|
|
|
27
29
|
main()
|
|
28
30
|
"""
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
def get_latest_pycharm_download_link():
|
|
33
|
+
url = "https://www.jetbrains.com/pycharm/download/"
|
|
34
|
+
headers = {
|
|
35
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
response = requests.get(url, headers=headers)
|
|
39
|
+
if response.status_code != 200:
|
|
40
|
+
raise Exception("Failed to load the download page")
|
|
41
|
+
|
|
42
|
+
soup = BeautifulSoup(response.text, 'html.parser')
|
|
43
|
+
download_link = None
|
|
32
44
|
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
# Find the Professional version download link
|
|
46
|
+
for a in soup.find_all('a', href=True):
|
|
47
|
+
if '/download?code=PCC&platform=windows' in a['href']:
|
|
48
|
+
download_link = a['href']
|
|
49
|
+
break
|
|
35
50
|
|
|
36
|
-
|
|
37
|
-
|
|
51
|
+
if not download_link:
|
|
52
|
+
raise Exception("Could not find the download link for the latest version of PyCharm Professional")
|
|
38
53
|
|
|
39
|
-
|
|
40
|
-
temp_dir = tempfile.mkdtemp()
|
|
41
|
-
installer_path = os.path.join(temp_dir, file_name)
|
|
54
|
+
return f"https:{download_link}"
|
|
42
55
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
installer_path: str = None
|
|
57
|
+
try:
|
|
58
|
+
print_api("Fetching the latest PyCharm download link...")
|
|
59
|
+
download_url = get_latest_pycharm_download_link()
|
|
60
|
+
print_api(f"Download URL: {download_url}")
|
|
61
|
+
|
|
62
|
+
print_api("Starting the download...")
|
|
63
|
+
file_name = "pycharm-latest.exe"
|
|
64
|
+
# download_file(download_url, file_name)
|
|
65
|
+
installer_path = web.download(file_url=download_url, file_name=file_name)
|
|
66
|
+
print_api(f"Downloaded the latest version of PyCharm to {file_name}", color='green')
|
|
67
|
+
except Exception as e:
|
|
68
|
+
print_api(f"An error occurred: {e}")
|
|
69
|
+
|
|
70
|
+
if not installer_path:
|
|
71
|
+
print_api("Failed to download the latest version of PyCharm", color='red')
|
|
72
|
+
return 1
|
|
51
73
|
|
|
52
74
|
# Install PyCharm
|
|
53
75
|
# Run the installer
|
|
54
|
-
|
|
76
|
+
print_api("Running the installer...")
|
|
55
77
|
subprocess.run([installer_path, '/S'], check=True) # /S for silent installation
|
|
56
|
-
|
|
78
|
+
print_api("Installation complete.", color='green')
|
|
79
|
+
|
|
80
|
+
# Remove the installer
|
|
81
|
+
filesystem.remove_file(installer_path)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: atomicshop
|
|
3
|
-
Version: 2.12.
|
|
3
|
+
Version: 2.12.8
|
|
4
4
|
Summary: Atomic functions and classes to make developer life easier
|
|
5
5
|
Author: Denis Kras
|
|
6
6
|
License: MIT License
|
|
@@ -29,10 +29,11 @@ Classifier: Intended Audience :: Developers
|
|
|
29
29
|
Classifier: License :: OSI Approved :: MIT License
|
|
30
30
|
Classifier: Programming Language :: Python :: 3
|
|
31
31
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
32
|
-
Requires-Python: >=3.
|
|
32
|
+
Requires-Python: >=3.11
|
|
33
33
|
Description-Content-Type: text/markdown
|
|
34
34
|
License-File: LICENSE.txt
|
|
35
35
|
Requires-Dist: wheel
|
|
36
|
+
Requires-Dist: beautifulsoup4
|
|
36
37
|
Requires-Dist: cryptography
|
|
37
38
|
Requires-Dist: dnslib
|
|
38
39
|
Requires-Dist: dnspython
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=I042GM8K4BPXWv_yalQoh8HGBDQ1Denw1R0XH2xM51k,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
|
|
@@ -44,7 +44,7 @@ atomicshop/timer.py,sha256=KxBBgVM8po6pUJDW8TgY1UXj0iiDmRmL5XDCq0VHAfU,1670
|
|
|
44
44
|
atomicshop/urls.py,sha256=CQl1j1kjEVDlAuYJqYD9XxPF1SUSgrmG8PjlcXNEKsQ,597
|
|
45
45
|
atomicshop/uuids.py,sha256=JSQdm3ZTJiwPQ1gYe6kU0TKS_7suwVrHc8JZDGYlydM,2214
|
|
46
46
|
atomicshop/virtualization.py,sha256=LPP4vjE0Vr10R6DA4lqhfX_WaNdDGRAZUW0Am6VeGco,494
|
|
47
|
-
atomicshop/web.py,sha256=
|
|
47
|
+
atomicshop/web.py,sha256=yXZCPqkEgTcG0dk9kgxLQI0rALM608_d_fvxOU41gKw,11508
|
|
48
48
|
atomicshop/addons/PlayWrightCodegen.cmd,sha256=Z5cnllsyXD4F1W2h-WLEnyFkg5nZy0-hTGHRWXVOuW4,173
|
|
49
49
|
atomicshop/addons/ScriptExecution.cmd,sha256=8iC-uHs9MX9qUD_C2M7n9Xw4MZvwOfxT8H5v3hluVps,93
|
|
50
50
|
atomicshop/addons/a_setup_scripts/install_psycopg2_ubuntu.sh,sha256=lM7LkXQ2AxfFzDGyzSOfIS_zpg9bAD1k3JJ-qu5CdH8,81
|
|
@@ -156,7 +156,7 @@ atomicshop/wrappers/numpyw.py,sha256=sBV4gSKyr23kXTalqAb1oqttzE_2XxBooCui66jbAqc
|
|
|
156
156
|
atomicshop/wrappers/olefilew.py,sha256=biD5m58rogifCYmYhJBrAFb9O_Bn_spLek_9HofLeYE,2051
|
|
157
157
|
atomicshop/wrappers/pipw.py,sha256=mu4jnHkSaYNfpBiLZKMZxEX_E2LqW5BVthMZkblPB_c,1317
|
|
158
158
|
atomicshop/wrappers/process_wrapper_pbtk.py,sha256=ycPmBRnv627RWks6N8OhxJQe8Gu3h3Vwj-4HswPOw0k,599
|
|
159
|
-
atomicshop/wrappers/pycharmw.py,sha256=
|
|
159
|
+
atomicshop/wrappers/pycharmw.py,sha256=OHcaVlyhIqhgRioPhkeS5krDZ_NezZjpBCvyRiLjWwI,2723
|
|
160
160
|
atomicshop/wrappers/pyopensslw.py,sha256=OBWxA6EJ2vU_Qlf4M8m6ilcG3hyYB4yB0EsXUf7NhEU,6804
|
|
161
161
|
atomicshop/wrappers/ubuntu_terminal.py,sha256=BBZD3EH6KSDORd5IZBZM-ti4U6Qh1sZwftx42s7hqB4,10917
|
|
162
162
|
atomicshop/wrappers/wslw.py,sha256=AKphiHLSddL7ErevUowr3f9Y1AgGz_R3KZ3NssW07h8,6959
|
|
@@ -251,8 +251,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
|
|
|
251
251
|
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
|
|
252
252
|
atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
|
|
253
253
|
atomicshop/wrappers/socketw/statistics_csv.py,sha256=t3dtDEfN47CfYVi0CW6Kc2QHTEeZVyYhc57IYYh5nmA,826
|
|
254
|
-
atomicshop-2.12.
|
|
255
|
-
atomicshop-2.12.
|
|
256
|
-
atomicshop-2.12.
|
|
257
|
-
atomicshop-2.12.
|
|
258
|
-
atomicshop-2.12.
|
|
254
|
+
atomicshop-2.12.8.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
255
|
+
atomicshop-2.12.8.dist-info/METADATA,sha256=zHIPTb9wnVqipNdABp0gXEYDtJQvZ99EioWQdHJue8g,10478
|
|
256
|
+
atomicshop-2.12.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
257
|
+
atomicshop-2.12.8.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
258
|
+
atomicshop-2.12.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|