atomicshop 2.18.19__py3-none-any.whl → 2.18.21__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/wrappers/ctyping/file_details_winapi.py +43 -0
- atomicshop/wrappers/mongodbw/install_mongodb_ubuntu.py +2 -2
- atomicshop/wrappers/psutilw/processes.py +37 -1
- {atomicshop-2.18.19.dist-info → atomicshop-2.18.21.dist-info}/METADATA +1 -1
- {atomicshop-2.18.19.dist-info → atomicshop-2.18.21.dist-info}/RECORD +9 -8
- {atomicshop-2.18.19.dist-info → atomicshop-2.18.21.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.18.19.dist-info → atomicshop-2.18.21.dist-info}/WHEEL +0 -0
- {atomicshop-2.18.19.dist-info → atomicshop-2.18.21.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import ctypes
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def get_file_properties(file_path: str) -> dict:
|
|
6
|
+
"""
|
|
7
|
+
Retrieve file version properties using ctypes.
|
|
8
|
+
|
|
9
|
+
:param file_path: Full path to the file.
|
|
10
|
+
:return: Dictionary with file properties.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def query_value(name):
|
|
14
|
+
r = ctypes.c_void_p()
|
|
15
|
+
l = ctypes.c_uint()
|
|
16
|
+
ctypes.windll.version.VerQueryValueW(
|
|
17
|
+
res, f"\\StringFileInfo\\040904b0\\{name}", ctypes.byref(r), ctypes.byref(l))
|
|
18
|
+
return ctypes.wstring_at(r) if r.value else "N/A"
|
|
19
|
+
|
|
20
|
+
properties = {
|
|
21
|
+
"FileDescription": "N/A",
|
|
22
|
+
"FileVersion": "N/A",
|
|
23
|
+
"ProductName": "N/A",
|
|
24
|
+
"ProductVersion": "N/A",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if not os.path.isfile(file_path):
|
|
28
|
+
return properties
|
|
29
|
+
|
|
30
|
+
# Load version information
|
|
31
|
+
size = ctypes.windll.version.GetFileVersionInfoSizeW(file_path, None)
|
|
32
|
+
if size == 0:
|
|
33
|
+
return properties
|
|
34
|
+
|
|
35
|
+
res = ctypes.create_string_buffer(size)
|
|
36
|
+
ctypes.windll.version.GetFileVersionInfoW(file_path, None, size, res)
|
|
37
|
+
|
|
38
|
+
properties["FileDescription"] = query_value("FileDescription")
|
|
39
|
+
properties["FileVersion"] = query_value("FileVersion")
|
|
40
|
+
properties["ProductName"] = query_value("ProductName")
|
|
41
|
+
properties["ProductVersion"] = query_value("ProductVersion")
|
|
42
|
+
|
|
43
|
+
return properties
|
|
@@ -35,7 +35,7 @@ def install_mongodb(version):
|
|
|
35
35
|
# Step 1: Import the MongoDB public GPG key
|
|
36
36
|
print_api.print_api("Step 1: Importing the MongoDB public GPG key...")
|
|
37
37
|
run_command(f"curl -fsSL https://pgp.mongodb.com/server-{version}.asc | "
|
|
38
|
-
f"sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-{version}.gpg")
|
|
38
|
+
f"sudo gpg --dearmor --yes -o /usr/share/keyrings/mongodb-server-{version}.gpg")
|
|
39
39
|
|
|
40
40
|
# Step 2: Create the MongoDB list file for APT
|
|
41
41
|
print_api.print_api("Step 2: Creating MongoDB APT list file...")
|
|
@@ -71,7 +71,7 @@ def install_main(
|
|
|
71
71
|
# Ensure the user provides a MongoDB major version as an argument.
|
|
72
72
|
if len(sys.argv) != 2:
|
|
73
73
|
message: str = ("Usage: python install_mongodb.py <mongo_major_version>\n"
|
|
74
|
-
"Example: python install_mongodb.py
|
|
74
|
+
"Example: python install_mongodb.py 8")
|
|
75
75
|
print_api.print_api(message, color='red')
|
|
76
76
|
return 1
|
|
77
77
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import os
|
|
2
2
|
import time
|
|
3
3
|
|
|
4
|
+
import psutil
|
|
5
|
+
|
|
4
6
|
from ...print_api import print_api
|
|
7
|
+
from ..ctyping import file_details_winapi
|
|
5
8
|
|
|
6
9
|
|
|
7
10
|
def wait_for_process(pid: int):
|
|
@@ -43,3 +46,36 @@ def kill_process_by_pid(pid: int, print_kwargs: dict = None):
|
|
|
43
46
|
except psutil.TimeoutExpired:
|
|
44
47
|
# print(f"Process {pid} did not terminate in time.")
|
|
45
48
|
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def get_running_processes_with_exe_info() -> list[dict]:
|
|
52
|
+
"""
|
|
53
|
+
Retrieve information about all running processes on the system.
|
|
54
|
+
"""
|
|
55
|
+
processes_info: list[dict] = []
|
|
56
|
+
|
|
57
|
+
for proc in psutil.process_iter(attrs=["pid", "name", "exe"]):
|
|
58
|
+
try:
|
|
59
|
+
pid = proc.info["pid"]
|
|
60
|
+
name = proc.info["name"]
|
|
61
|
+
exe = proc.info["exe"]
|
|
62
|
+
|
|
63
|
+
if exe and os.path.isfile(exe):
|
|
64
|
+
# Get file properties
|
|
65
|
+
file_properties = file_details_winapi.get_file_properties(exe)
|
|
66
|
+
|
|
67
|
+
# Add process info to the list
|
|
68
|
+
processes_info.append({
|
|
69
|
+
"PID": pid,
|
|
70
|
+
"Name": name,
|
|
71
|
+
"FilePath": exe,
|
|
72
|
+
"FileDescription": file_properties["FileDescription"],
|
|
73
|
+
"FileVersion": file_properties["FileVersion"],
|
|
74
|
+
"ProductName": file_properties["ProductName"],
|
|
75
|
+
"ProductVersion": file_properties["ProductVersion"],
|
|
76
|
+
})
|
|
77
|
+
except (psutil.AccessDenied, psutil.NoSuchProcess, psutil.ZombieProcess):
|
|
78
|
+
# Skip processes that cannot be accessed
|
|
79
|
+
continue
|
|
80
|
+
|
|
81
|
+
return processes_info
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=afVD382Lo8IDjEjcbwr_LURBwwB7IlhD80mWtxzgH_0,124
|
|
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
|
|
@@ -199,6 +199,7 @@ atomicshop/wrappers/wslw.py,sha256=2Z7X0j5M2hoRZjbHfm_vqwNXZeptsdkNCdhdcM_S9vo,6
|
|
|
199
199
|
atomicshop/wrappers/certauthw/certauth.py,sha256=hKedW0DOWlEigSNm8wu4SqHkCQsGJ1tJfH7s4nr3Bk0,12223
|
|
200
200
|
atomicshop/wrappers/certauthw/certauthw.py,sha256=4WvhjANI7Kzqrr_nKmtA8Kf7B6rute_5wfP65gwQrjw,8082
|
|
201
201
|
atomicshop/wrappers/ctyping/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
202
|
+
atomicshop/wrappers/ctyping/file_details_winapi.py,sha256=p2BdQy-UNwL8h-4IRzVBV6tQMzywXeSbAnm62fjdEvM,1318
|
|
202
203
|
atomicshop/wrappers/ctyping/process_winapi.py,sha256=QcXL-ETtlSSkoT8F7pYle97ubGWsjYp8cx8HxkVMgAc,2762
|
|
203
204
|
atomicshop/wrappers/ctyping/win_console.py,sha256=uTtjkz9rY559AaV0dhyZYUSSEe9cn6Du2DgurdMtX-M,1158
|
|
204
205
|
atomicshop/wrappers/ctyping/etw_winapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -259,7 +260,7 @@ atomicshop/wrappers/loggingw/loggers.py,sha256=mmM__XR3W4QC82wbsDRG_M4_0JYGGEP0Q
|
|
|
259
260
|
atomicshop/wrappers/loggingw/loggingw.py,sha256=uLY7DJS-3xIYQBRvI--9eFvdcnvsWSXmtJKS-gTRfjM,20863
|
|
260
261
|
atomicshop/wrappers/loggingw/reading.py,sha256=sCNlgqLNH5XdKqOOjjEox7CvViMHzs6h7-hwCnx4NKk,17566
|
|
261
262
|
atomicshop/wrappers/mongodbw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
262
|
-
atomicshop/wrappers/mongodbw/install_mongodb_ubuntu.py,sha256=
|
|
263
|
+
atomicshop/wrappers/mongodbw/install_mongodb_ubuntu.py,sha256=2eEOb35T259lhn5koynfTIm1hanxD02zN97ExGSBM2o,4021
|
|
263
264
|
atomicshop/wrappers/mongodbw/install_mongodb_win.py,sha256=64EUQYx7VuMC3ndO2x3nSErh5NZ_BsqMwGvPcybfC-Q,8499
|
|
264
265
|
atomicshop/wrappers/mongodbw/mongo_infra.py,sha256=IjEF0jPzQz866MpTm7rnksnyyWQeUT_B2h2DA9ryAio,2034
|
|
265
266
|
atomicshop/wrappers/mongodbw/mongodbw.py,sha256=ih3Gd45rg_70y4sGeu0eEJ3sJd9tEN4I5IqHZelRZJw,52854
|
|
@@ -281,7 +282,7 @@ atomicshop/wrappers/psutilw/cpus.py,sha256=w6LPBMINqS-T_X8vzdYkLS2Wzuve28Ydp_Gaf
|
|
|
281
282
|
atomicshop/wrappers/psutilw/disks.py,sha256=3ZSVoommKH1TWo37j_83frB-NqXF4Nf5q5mBCX8G4jE,9221
|
|
282
283
|
atomicshop/wrappers/psutilw/memories.py,sha256=_S0aL8iaoIHebd1vOFrY_T9aROM5Jx2D5CvDh_4j0Vc,528
|
|
283
284
|
atomicshop/wrappers/psutilw/networks.py,sha256=uv0QN-7Abp15iQ2leWj6oIoItBtBKhuLkN0i9w0vHaM,2591
|
|
284
|
-
atomicshop/wrappers/psutilw/processes.py,sha256=
|
|
285
|
+
atomicshop/wrappers/psutilw/processes.py,sha256=ihYnxfMTVEXHWy92iewktoZGxazx3v5QCIn0bNLnfsU,2859
|
|
285
286
|
atomicshop/wrappers/psutilw/psutilw.py,sha256=q3EwgprqyrR4zLCjl4l5DHFOQoukEvQMIPjNB504oQ0,21262
|
|
286
287
|
atomicshop/wrappers/psycopgw/psycopgw.py,sha256=XJvVf0oAUjCHkrYfKeFuGCpfn0Oxj3u4SbKMKA1508E,7118
|
|
287
288
|
atomicshop/wrappers/pycharmw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -320,8 +321,8 @@ atomicshop/wrappers/socketw/statistics_csv.py,sha256=fgMzDXI0cybwUEqAxprRmY3lqbh
|
|
|
320
321
|
atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
321
322
|
atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
|
|
322
323
|
atomicshop/wrappers/winregw/winreg_network.py,sha256=AENV88H1qDidrcpyM9OwEZxX5svfi-Jb4N6FkS1xtqA,8851
|
|
323
|
-
atomicshop-2.18.
|
|
324
|
-
atomicshop-2.18.
|
|
325
|
-
atomicshop-2.18.
|
|
326
|
-
atomicshop-2.18.
|
|
327
|
-
atomicshop-2.18.
|
|
324
|
+
atomicshop-2.18.21.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
325
|
+
atomicshop-2.18.21.dist-info/METADATA,sha256=u3e7axWa2C7VBbeTb1UbHy1GFp1WNl0Iv2ga7gMZXQ8,10577
|
|
326
|
+
atomicshop-2.18.21.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
327
|
+
atomicshop-2.18.21.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
328
|
+
atomicshop-2.18.21.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|