atomicshop 3.1.4__py3-none-any.whl → 3.1.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 +1 -1
- atomicshop/networks.py +12 -1
- atomicshop/web.py +12 -2
- atomicshop/wrappers/pycharmw/win.py +1 -1
- atomicshop/wrappers/pywin32w/wmis/msft_netipaddress.py +38 -1
- {atomicshop-3.1.4.dist-info → atomicshop-3.1.6.dist-info}/METADATA +1 -1
- {atomicshop-3.1.4.dist-info → atomicshop-3.1.6.dist-info}/RECORD +10 -10
- {atomicshop-3.1.4.dist-info → atomicshop-3.1.6.dist-info}/LICENSE.txt +0 -0
- {atomicshop-3.1.4.dist-info → atomicshop-3.1.6.dist-info}/WHEEL +0 -0
- {atomicshop-3.1.4.dist-info → atomicshop-3.1.6.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/networks.py
CHANGED
|
@@ -432,15 +432,26 @@ def add_virtual_ips_to_default_adapter_by_current_setting(
|
|
|
432
432
|
if dns_gateways is None:
|
|
433
433
|
dns_gateways = default_adapter_info['dns_gateways']
|
|
434
434
|
|
|
435
|
+
# We will get the default IP address of the machine.
|
|
436
|
+
default_ip_address: str = socket.gethostbyname(socket.gethostname())
|
|
437
|
+
# So we can make it the first IP in the list, but first remove it from the list.
|
|
438
|
+
_ = ips.pop(ips.index(default_ip_address))
|
|
439
|
+
# At this point we will copy the list of IPs that we will set the SkipAsSource flag for.
|
|
440
|
+
ips_for_skip_as_source = ips.copy()
|
|
441
|
+
# Add it back to the beginning of the list.
|
|
442
|
+
ips.insert(0, default_ip_address)
|
|
443
|
+
|
|
435
444
|
win32_networkadapterconfiguration.set_static_ips(
|
|
436
445
|
default_network_adapter_config, ips=ips, masks=masks,
|
|
437
446
|
gateways=gateways, dns_gateways=dns_gateways,
|
|
438
447
|
availability_wait_seconds=availability_wait_seconds)
|
|
439
448
|
|
|
449
|
+
# If there were already virtual IPs assigned to the adapter and already were set SkipAsSource,
|
|
450
|
+
# we need to set SkipAsSource for them once again as well as for the new IPs.
|
|
440
451
|
if set_virtual_ips_skip_as_source:
|
|
441
452
|
wmi_standard_cimv2_instance, _ = wmi_helpers.get_wmi_instance(
|
|
442
453
|
namespace='root\\StandardCimv2', wmi_instance=wmi_civ2_instance, locator=locator)
|
|
443
|
-
msft_netipaddress.set_skip_as_source(
|
|
454
|
+
msft_netipaddress.set_skip_as_source(ips_for_skip_as_source, enable=True, wmi_instance=wmi_standard_cimv2_instance)
|
|
444
455
|
else:
|
|
445
456
|
# print("[!] No new IPs to assign.")
|
|
446
457
|
pass
|
atomicshop/web.py
CHANGED
|
@@ -157,6 +157,7 @@ def download(
|
|
|
157
157
|
target_directory: str = None,
|
|
158
158
|
file_name: str = None,
|
|
159
159
|
headers: dict = None,
|
|
160
|
+
use_certifi_ca_repository: bool = False,
|
|
160
161
|
**kwargs
|
|
161
162
|
) -> str:
|
|
162
163
|
"""
|
|
@@ -168,6 +169,8 @@ def download(
|
|
|
168
169
|
:param file_name: string, file name (example: file.zip) that you want the downloaded file to be saved as.
|
|
169
170
|
If not specified, the default filename from 'file_url' will be used.
|
|
170
171
|
:param headers: dictionary, HTTP headers to use when downloading the file.
|
|
172
|
+
:param use_certifi_ca_repository: boolean, if True, the certifi CA store will be used for SSL context
|
|
173
|
+
instead of the system's default CA store.
|
|
171
174
|
:return: string, full file path of downloaded file. If download failed, 'None' will be returned.
|
|
172
175
|
"""
|
|
173
176
|
|
|
@@ -196,8 +199,15 @@ def download(
|
|
|
196
199
|
print_api.print_api(f'Downloading: {file_url}', **kwargs)
|
|
197
200
|
print_api.print_api(f'To: {file_path}', **kwargs)
|
|
198
201
|
|
|
199
|
-
# Open the URL for data gathering with SSL context
|
|
200
|
-
|
|
202
|
+
# Open the URL for data gathering with SSL context.
|
|
203
|
+
if not use_certifi_ca_repository:
|
|
204
|
+
# Create a default SSL context using the system's CA store.
|
|
205
|
+
ssl_context = ssl.create_default_context()
|
|
206
|
+
else:
|
|
207
|
+
# Create a default SSL context using the certifi CA store.
|
|
208
|
+
# This is useful for environments where the system's CA store is not available or not trusted.
|
|
209
|
+
# 'certifi.where()' returns the path to the certifi CA bundle.
|
|
210
|
+
ssl_context = ssl.create_default_context(cafile=certifi.where())
|
|
201
211
|
|
|
202
212
|
# In order to use 'urllib.request', it is not enough to 'import urllib', you need to 'import urllib.request'.
|
|
203
213
|
# Build a Request object with headers if provided.
|
|
@@ -62,7 +62,7 @@ def download_install_main():
|
|
|
62
62
|
print_api("Starting the download...")
|
|
63
63
|
file_name = "pycharm-latest.exe"
|
|
64
64
|
# download_file(download_url, file_name)
|
|
65
|
-
installer_path = web.download(file_url=download_url, file_name=file_name)
|
|
65
|
+
installer_path = web.download(file_url=download_url, file_name=file_name, use_certifi_ca_repository=True)
|
|
66
66
|
print_api(f"Downloaded the latest version of PyCharm to {file_name}", color='green')
|
|
67
67
|
except Exception as e:
|
|
68
68
|
print_api(f"An error occurred: {e}")
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from win32com.client import CDispatch
|
|
2
4
|
|
|
3
5
|
from . import wmi_helpers
|
|
@@ -73,4 +75,39 @@ def set_skip_as_source(
|
|
|
73
75
|
|
|
74
76
|
obj.SkipAsSource = enable
|
|
75
77
|
obj.Put_() # commit the change
|
|
76
|
-
print(f"[+] {ip}: SkipAsSource set to {enable}")
|
|
78
|
+
print(f"[+] {ip}: SkipAsSource set to {enable}")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def is_skip_as_source(
|
|
82
|
+
ip_address: str,
|
|
83
|
+
wmi_instance: CDispatch = None
|
|
84
|
+
) -> Optional[bool]:
|
|
85
|
+
"""
|
|
86
|
+
Check whether *ip_address* currently has SkipAsSource set.
|
|
87
|
+
|
|
88
|
+
Returns
|
|
89
|
+
-------
|
|
90
|
+
True – the flag is enabled
|
|
91
|
+
False – the flag is disabled
|
|
92
|
+
None – no MSFT_NetIPAddress object matches the IP (not present)
|
|
93
|
+
|
|
94
|
+
Notes
|
|
95
|
+
-----
|
|
96
|
+
* Works for both IPv4/IPv6.
|
|
97
|
+
* Uses the same Win32 CIM class (root\\StandardCimv2 › MSFT_NetIPAddress).
|
|
98
|
+
* You can pass an existing `wmi_instance` to avoid reconnecting in tight loops.
|
|
99
|
+
"""
|
|
100
|
+
# Get a WMI connection if the caller didn’t hand us one
|
|
101
|
+
if not wmi_instance:
|
|
102
|
+
wmi_instance, _ = wmi_helpers.get_wmi_instance(namespace='root\\StandardCimv2')
|
|
103
|
+
|
|
104
|
+
query = f"SELECT SkipAsSource FROM MSFT_NetIPAddress WHERE IPAddress='{ip_address}'"
|
|
105
|
+
matches = wmi_instance.ExecQuery(query)
|
|
106
|
+
|
|
107
|
+
if not matches: # address not configured on this host/NIC
|
|
108
|
+
return None
|
|
109
|
+
|
|
110
|
+
# There should be only one entry per literal IP, but handle duplicates sanely
|
|
111
|
+
# Return True if *any* matching record has SkipAsSource = True,
|
|
112
|
+
# otherwise False (all are False).
|
|
113
|
+
return any(bool(obj.SkipAsSource) for obj in matches)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=lgJ4Y2cZjapTRcmtqh6h2LaQj-h7MwBqzq-fHO09skc,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
|
|
@@ -23,7 +23,7 @@ atomicshop/http_parse.py,sha256=1Tna9YbOM0rE3t6i_M-klBlwd1KNSA9skA_BqKGXDFc,1186
|
|
|
23
23
|
atomicshop/inspect_wrapper.py,sha256=sGRVQhrJovNygHTydqJj0hxES-aB2Eg9KbIk3G31apw,11429
|
|
24
24
|
atomicshop/ip_addresses.py,sha256=penRFeJ1-LDVTko4Q0EwK4JiN5cU-KzCBR2VXg9qbUY,1238
|
|
25
25
|
atomicshop/keyboard_press.py,sha256=1W5kRtOB75fulVx-uF2yarBhW0_IzdI1k73AnvXstk0,452
|
|
26
|
-
atomicshop/networks.py,sha256=
|
|
26
|
+
atomicshop/networks.py,sha256=OSFaEUu8otxCkNq9oMbYQpj5SLzHie2r5uJDiyLR19U,18685
|
|
27
27
|
atomicshop/on_exit.py,sha256=9XlOnzoAG8zlI8wBF4AB8hyrC6Q1b84gkhqpAhhdN9g,6977
|
|
28
28
|
atomicshop/pbtkmultifile_argparse.py,sha256=aEk8nhvoQVu-xyfZosK3ma17CwIgOjzO1erXXdjwtS4,4574
|
|
29
29
|
atomicshop/print_api.py,sha256=SJNQIMqSLlYaPtjHnALySAI-jQYuYHOCGgfP7oe96fU,10957
|
|
@@ -47,7 +47,7 @@ atomicshop/uuids.py,sha256=JSQdm3ZTJiwPQ1gYe6kU0TKS_7suwVrHc8JZDGYlydM,2214
|
|
|
47
47
|
atomicshop/venvs.py,sha256=D9lwOoObkYoRx-weuoAmbvN-RdSHhVm4DE9TVl-utAs,903
|
|
48
48
|
atomicshop/versioning.py,sha256=e5W6m9AF3__M5nntqI9CqNAeHqkwY9JhlnpYeZ1CEus,970
|
|
49
49
|
atomicshop/virtualization.py,sha256=LPP4vjE0Vr10R6DA4lqhfX_WaNdDGRAZUW0Am6VeGco,494
|
|
50
|
-
atomicshop/web.py,sha256=
|
|
50
|
+
atomicshop/web.py,sha256=hkAS0MeMW_mGgxhFCX1xckT3yslCJ2cMP2nx9ADpe3o,13024
|
|
51
51
|
atomicshop/websocket_parse.py,sha256=aLHWyKqaYqEn_MRBWm2L6rIl6QPmqbVrjEXE_rBzwCw,16711
|
|
52
52
|
atomicshop/a_installs/ubuntu/docker_rootless.py,sha256=9IPNtGZYjfy1_n6ZRt7gWz9KZgR6XCgevjqq02xk-o0,281
|
|
53
53
|
atomicshop/a_installs/ubuntu/docker_sudo.py,sha256=JzayxeyKDtiuT4Icp2L2LyFRbx4wvpyN_bHLfZ-yX5E,281
|
|
@@ -300,7 +300,7 @@ atomicshop/wrappers/psutilw/psutilw.py,sha256=q3EwgprqyrR4zLCjl4l5DHFOQoukEvQMIP
|
|
|
300
300
|
atomicshop/wrappers/psycopgw/psycopgw.py,sha256=XJvVf0oAUjCHkrYfKeFuGCpfn0Oxj3u4SbKMKA1508E,7118
|
|
301
301
|
atomicshop/wrappers/pycharmw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
302
302
|
atomicshop/wrappers/pycharmw/ubuntu.py,sha256=m9MpgqvIYygulhPxo9g2zlGGXrihBpiY3GNLNyT-B7U,1290
|
|
303
|
-
atomicshop/wrappers/pycharmw/win.py,sha256=
|
|
303
|
+
atomicshop/wrappers/pycharmw/win.py,sha256=hNP-d95z1zhcCpYqhHE5HZVYxaAlt8JJCNXh65jZsHc,2757
|
|
304
304
|
atomicshop/wrappers/pywin32w/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
305
305
|
atomicshop/wrappers/pywin32w/cert_store.py,sha256=dV1XyoKTFKZ-HCIVqU2Nd6CTZ8HANqjAXv26rsNzO6s,4365
|
|
306
306
|
atomicshop/wrappers/pywin32w/console.py,sha256=LstHajPLgXp9qQxFNR44QfH10nOnNp3bCJquxaTquns,1175
|
|
@@ -312,7 +312,7 @@ atomicshop/wrappers/pywin32w/win_event_log/subscribes/process_create.py,sha256=I
|
|
|
312
312
|
atomicshop/wrappers/pywin32w/win_event_log/subscribes/process_terminate.py,sha256=OJFWywGGGkBHq1N0MKGtHSFFQMFQSDVU6FXCRIdssg8,3761
|
|
313
313
|
atomicshop/wrappers/pywin32w/win_event_log/subscribes/schannel_logging.py,sha256=8nxIcNcbeEuvoBwhujgh7-oIpL9A6J-gg1NM8hOGAVA,3442
|
|
314
314
|
atomicshop/wrappers/pywin32w/wmis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
315
|
-
atomicshop/wrappers/pywin32w/wmis/msft_netipaddress.py,sha256=
|
|
315
|
+
atomicshop/wrappers/pywin32w/wmis/msft_netipaddress.py,sha256=Kn2gQsyEquM5QQkdF2Vtr1MqK5D7uo6EFi-cxt52Q0g,4800
|
|
316
316
|
atomicshop/wrappers/pywin32w/wmis/win32_networkadapterconfiguration.py,sha256=Iz-p--cE2iP6wyD9ceSF3scMMvdXC5fF-VKP1v-iIDo,10813
|
|
317
317
|
atomicshop/wrappers/pywin32w/wmis/win32networkadapter.py,sha256=iao4OK6u097uRacw6vQuya1kOtJzLA1IM4cgo6UCWLM,3941
|
|
318
318
|
atomicshop/wrappers/pywin32w/wmis/win32process.py,sha256=qMzXtJ5hBZ5ydAyqpDbSx0nO2RJQL95HdmV5SzNKMhk,6826
|
|
@@ -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.
|
|
340
|
-
atomicshop-3.1.
|
|
341
|
-
atomicshop-3.1.
|
|
342
|
-
atomicshop-3.1.
|
|
343
|
-
atomicshop-3.1.
|
|
339
|
+
atomicshop-3.1.6.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
340
|
+
atomicshop-3.1.6.dist-info/METADATA,sha256=nOFaTyw74lY191rFSACO5nChQHK6jRcTq4yPfbvOj2A,10653
|
|
341
|
+
atomicshop-3.1.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
342
|
+
atomicshop-3.1.6.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
343
|
+
atomicshop-3.1.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|