pyhw 0.13.4__tar.gz → 0.14.0__tar.gz
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.
- {pyhw-0.13.4/src/pyhw.egg-info → pyhw-0.14.0}/PKG-INFO +1 -1
- {pyhw-0.13.4 → pyhw-0.14.0}/pyproject.toml +1 -1
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/__init__.py +1 -1
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/__main__.py +76 -23
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/gpu/linux.py +2 -2
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/gpu/windows.py +2 -2
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/nic/linux.py +2 -2
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/nic/windows.py +2 -2
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/npu/linux.py +2 -2
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/npu/windows.py +2 -2
- pyhw-0.14.0/src/pyhw/pyhwUtil/__init__.py +16 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/pyhwUtil/cliUtil.py +5 -2
- pyhw-0.14.0/src/pyhw/pyhwUtil/pciUtil.py +11 -0
- {pyhw-0.13.4 → pyhw-0.14.0/src/pyhw.egg-info}/PKG-INFO +1 -1
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw.egg-info/SOURCES.txt +1 -0
- pyhw-0.13.4/src/pyhw/pyhwUtil/__init__.py +0 -6
- {pyhw-0.13.4 → pyhw-0.14.0}/LICENSE +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/README.md +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/setup.cfg +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/backendBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/cpu/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/cpu/bsd.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/cpu/cpuBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/cpu/cpuInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/cpu/linux.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/cpu/macos.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/cpu/windows.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/gpu/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/gpu/bsd.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/gpu/gpuBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/gpu/gpuInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/gpu/macos.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/host/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/host/bsd.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/host/hostBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/host/hostInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/host/linux.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/host/macos.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/host/windows.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/kernel/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/kernel/kernelBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/kernel/kernelInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/kernel/unix.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/kernel/windows.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/memory/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/memory/bsd.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/memory/linux.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/memory/macos.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/memory/memoryBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/memory/memoryInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/memory/windows.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/nic/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/nic/bsd.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/nic/macos.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/nic/nicBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/nic/nicInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/npu/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/npu/bsd.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/npu/macos.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/npu/npuBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/npu/npuInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/os/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/os/bsd.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/os/linux.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/os/macos.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/os/osBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/os/osInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/os/windows.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/shell/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/shell/shellBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/shell/shellInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/shell/unix.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/shell/windows.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/title/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/title/titleBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/title/titleInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/title/unix.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/title/windows.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/uptime/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/uptime/bsd.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/uptime/linux.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/uptime/macos.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/uptime/uptimeBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/uptime/uptimeInfo.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/backend/uptime/windows.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/color/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/color/colorConfig.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/color/colorSet.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/color/colorUtil.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/frontendBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/alpine.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/arch.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/armbian.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/centos.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/debian.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/fedora.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/fedora_small.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/freebsd.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/kali.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/linux.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/linuxmint.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/macOS.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/opensuse-leap.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/opensuse-tumbleweed.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/raspbian.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/rhel.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/ubuntu.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/ubuntu_small.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/windows_10.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/windows_11.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/windows_2025.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/ascii/windows_old.pyhw +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/frontend/logo/logoBase.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/library/lib/iokitCPULib.dylib +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/library/lib/iokitGPULib.dylib +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/library/lib/iokitHostLib.dylib +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/library/lib/nvmlGPULib_amd64.so +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/library/lib/nvmlGPULib_arm64.so +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/library/test/iokitCPULibTest.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/library/test/iokitHostLibTest.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/library/test/nvmlGPULibTest.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/pyhwException/__init__.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/pyhwException/pyhwException.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/pyhwUtil/pyhwUtil.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw/pyhwUtil/sysctlUtil.py +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw.egg-info/dependency_links.txt +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw.egg-info/entry_points.txt +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw.egg-info/requires.txt +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/src/pyhw.egg-info/top_level.txt +0 -0
- {pyhw-0.13.4 → pyhw-0.14.0}/test/test_cliUtil.py +0 -0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "pyhw"
|
7
|
-
version = "0.
|
7
|
+
version = "0.14.0"
|
8
8
|
description = "PyHw, a neofetch-like command line tool for fetching system information but written mostly in python."
|
9
9
|
keywords = ["neofetch", "system information", "command line tool", "python", "hardware information", "fastfetch", "fetching"]
|
10
10
|
authors = [
|
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = '0.
|
1
|
+
__version__ = '0.14.0'
|
2
2
|
__author__ = 'xiaoran007'
|
@@ -17,6 +17,26 @@ from .pyhwUtil import ReleaseChecker
|
|
17
17
|
from .frontend.color import colorPrefix, colorSuffix, ColorSet
|
18
18
|
import multiprocessing
|
19
19
|
import argparse
|
20
|
+
import time
|
21
|
+
import functools
|
22
|
+
|
23
|
+
|
24
|
+
def timed_function(func):
|
25
|
+
@functools.wraps(func)
|
26
|
+
def wrapper(debug_info, os, result_dict):
|
27
|
+
if not debug_info.get('debug', False):
|
28
|
+
return func(debug_info, os, result_dict)
|
29
|
+
|
30
|
+
start_time = time.time()
|
31
|
+
result = func(debug_info, os, result_dict)
|
32
|
+
elapsed = time.time() - start_time
|
33
|
+
debug_dict = debug_info.get('debug_dict', {})
|
34
|
+
if debug_dict is not None:
|
35
|
+
debug_dict[func.__name__] = elapsed
|
36
|
+
return result
|
37
|
+
|
38
|
+
wrapper.__module__ = func.__module__
|
39
|
+
return wrapper
|
20
40
|
|
21
41
|
|
22
42
|
def check_release(release_dict):
|
@@ -27,64 +47,83 @@ def check_release(release_dict):
|
|
27
47
|
release_dict["is_in_pipx"] = releaseChecker.isInPIPX
|
28
48
|
|
29
49
|
|
30
|
-
|
50
|
+
@timed_function
|
51
|
+
def detect_title(debug_info, os, result_dict):
|
31
52
|
result_dict["title"] = TitleDetect(os=os).getTitle().title
|
32
53
|
|
33
54
|
|
34
|
-
|
55
|
+
@timed_function
|
56
|
+
def detect_host(debug_info, os, result_dict):
|
35
57
|
result_dict["Host"] = HostDetect(os=os).getHostInfo().model
|
36
58
|
|
37
59
|
|
38
|
-
|
60
|
+
@timed_function
|
61
|
+
def detect_kernel(debug_info, os, result_dict):
|
39
62
|
result_dict["Kernel"] = KernelDetect(os=os).getKernelInfo().kernel
|
40
63
|
|
41
64
|
|
42
|
-
|
65
|
+
@timed_function
|
66
|
+
def detect_shell(debug_info, os, result_dict):
|
43
67
|
result_dict["Shell"] = ShellDetect(os=os).getShellInfo().info
|
44
68
|
|
45
69
|
|
46
|
-
|
70
|
+
@timed_function
|
71
|
+
def detect_uptime(debug_info, os, result_dict):
|
47
72
|
result_dict["Uptime"] = UptimeDetect(os=os).getUptime().uptime
|
48
73
|
|
49
74
|
|
50
|
-
|
75
|
+
@timed_function
|
76
|
+
def detect_os(debug_info, os, result_dict):
|
51
77
|
result_dict["OS"] = OSDetect(os=os).getOSInfo().prettyName
|
52
78
|
|
53
79
|
|
54
|
-
|
80
|
+
@timed_function
|
81
|
+
def detect_cpu(debug_info, os, result_dict):
|
55
82
|
result_dict["CPU"] = CPUDetect(os=os).getCPUInfo().cpu
|
56
83
|
|
57
84
|
|
58
|
-
|
85
|
+
@timed_function
|
86
|
+
def detect_gpu(debug_info, os, result_dict):
|
59
87
|
gpu_info = GPUDetect(os=os).getGPUInfo()
|
60
88
|
if gpu_info.number > 0:
|
61
89
|
result_dict["GPU"] = gpu_info.gpus
|
62
90
|
|
63
91
|
|
64
|
-
|
92
|
+
@timed_function
|
93
|
+
def detect_memory(debug_info, os, result_dict):
|
65
94
|
result_dict["Memory"] = MemoryDetect(os=os).getMemoryInfo().memory
|
66
95
|
|
67
96
|
|
68
|
-
|
97
|
+
@timed_function
|
98
|
+
def detect_nic(debug_info, os, result_dict):
|
69
99
|
nic_info = NICDetect(os=os).getNICInfo()
|
70
100
|
if nic_info.number > 0:
|
71
101
|
result_dict["NIC"] = nic_info.nics
|
72
102
|
|
73
103
|
|
74
|
-
|
104
|
+
@timed_function
|
105
|
+
def detect_npu(debug_info, os, result_dict):
|
75
106
|
npu_info = NPUDetect(os=os).getNPUInfo()
|
76
107
|
if npu_info.number > 0:
|
77
108
|
result_dict["NPU"] = npu_info.npus
|
78
109
|
|
79
110
|
|
111
|
+
@timed_function
|
112
|
+
def detect_pci_related(debug_info, os, result_dict):
|
113
|
+
detect_gpu(debug_info, os, result_dict)
|
114
|
+
detect_nic(debug_info, os, result_dict)
|
115
|
+
detect_npu(debug_info, os, result_dict)
|
116
|
+
|
117
|
+
|
80
118
|
def print_version():
|
81
|
-
releaseChecker = ReleaseChecker()
|
119
|
+
releaseChecker = ReleaseChecker(only_local=True)
|
82
120
|
print(f"pyhw v{releaseChecker.CurrentVersion}")
|
83
121
|
|
84
122
|
|
85
123
|
def main():
|
86
124
|
parser = argparse.ArgumentParser(description='PyHw, a neofetch-like command line tool for fetching system information')
|
87
125
|
parser.add_argument('-v', '--version', action='store_true', help='Print version information and exit')
|
126
|
+
parser.add_argument('-d', '--debug', action='store_true', help='Run in debug mode')
|
88
127
|
|
89
128
|
args = parser.parse_args()
|
90
129
|
|
@@ -102,34 +141,48 @@ def main():
|
|
102
141
|
manager = multiprocessing.Manager()
|
103
142
|
result_dict = manager.dict()
|
104
143
|
release_dict = manager.dict()
|
144
|
+
debug_dict = manager.dict() if args.debug else None
|
145
|
+
debug_info = {'debug': args.debug, 'debug_dict': debug_dict}
|
105
146
|
|
106
147
|
processes = [
|
107
148
|
multiprocessing.Process(target=check_release, args=(release_dict,)),
|
108
|
-
multiprocessing.Process(target=detect_title, args=(current_os, result_dict)),
|
109
|
-
multiprocessing.Process(target=detect_host, args=(current_os, result_dict)),
|
110
|
-
multiprocessing.Process(target=detect_kernel, args=(current_os, result_dict)),
|
111
|
-
multiprocessing.Process(target=detect_shell, args=(current_os, result_dict)),
|
112
|
-
multiprocessing.Process(target=detect_uptime, args=(current_os, result_dict)),
|
113
|
-
multiprocessing.Process(target=detect_os, args=(current_os, result_dict)),
|
114
|
-
multiprocessing.Process(target=detect_cpu, args=(current_os, result_dict)),
|
115
|
-
multiprocessing.Process(target=
|
116
|
-
multiprocessing.Process(target=
|
117
|
-
multiprocessing.Process(target=detect_nic, args=(current_os, result_dict)),
|
118
|
-
multiprocessing.Process(target=detect_npu, args=(current_os, result_dict)),
|
149
|
+
multiprocessing.Process(target=detect_title, args=(debug_info, current_os, result_dict)),
|
150
|
+
multiprocessing.Process(target=detect_host, args=(debug_info, current_os, result_dict)),
|
151
|
+
multiprocessing.Process(target=detect_kernel, args=(debug_info, current_os, result_dict)),
|
152
|
+
multiprocessing.Process(target=detect_shell, args=(debug_info, current_os, result_dict)),
|
153
|
+
multiprocessing.Process(target=detect_uptime, args=(debug_info, current_os, result_dict)),
|
154
|
+
multiprocessing.Process(target=detect_os, args=(debug_info, current_os, result_dict)),
|
155
|
+
multiprocessing.Process(target=detect_cpu, args=(debug_info, current_os, result_dict)),
|
156
|
+
multiprocessing.Process(target=detect_memory, args=(debug_info, current_os, result_dict)),
|
157
|
+
multiprocessing.Process(target=detect_pci_related, args=(debug_info, current_os, result_dict)),
|
119
158
|
]
|
120
159
|
|
160
|
+
start_time = time.time()
|
121
161
|
for process in processes:
|
122
162
|
process.start()
|
123
163
|
|
124
164
|
for process in processes[1:]:
|
125
165
|
process.join()
|
126
166
|
|
167
|
+
total_time = time.time() - start_time
|
168
|
+
|
127
169
|
for key, value in result_dict.items():
|
128
170
|
setattr(data, key, value)
|
129
171
|
|
130
172
|
logo_os = selectOSLogo(OSDetect(os=current_os).getOSInfo().id)
|
131
173
|
Printer(logo_os=logo_os, data=createDataString(data)).cPrint()
|
132
174
|
|
175
|
+
if args.debug:
|
176
|
+
print("\n" + "="*50)
|
177
|
+
print(f"🔍 DEBUG MODE: Timing Information")
|
178
|
+
print("="*50)
|
179
|
+
for func_name, elapsed in debug_dict.items():
|
180
|
+
detection_name = func_name.replace("detect_", "")
|
181
|
+
print(f"{detection_name:<10}: {elapsed:.4f} s")
|
182
|
+
print("-"*50)
|
183
|
+
print(f"Total execution time: {total_time:.4f} s")
|
184
|
+
print("="*50)
|
185
|
+
|
133
186
|
timeout = 3
|
134
187
|
processes[0].join(timeout)
|
135
188
|
if processes[0].is_alive():
|
@@ -1,8 +1,8 @@
|
|
1
1
|
from .gpuInfo import GPUInfo
|
2
2
|
from ..cpu import CPUDetect
|
3
3
|
from ...pyhwUtil import getArch
|
4
|
+
from ...pyhwUtil import PCIManager
|
4
5
|
from pathlib import Path
|
5
|
-
import pypci
|
6
6
|
import ctypes
|
7
7
|
|
8
8
|
|
@@ -17,7 +17,7 @@ class GPUDetectLinux:
|
|
17
17
|
return self.__gpuInfo
|
18
18
|
|
19
19
|
def __getGPUInfo(self):
|
20
|
-
gpu_devices =
|
20
|
+
gpu_devices = PCIManager.get_instance().FindAllVGA()
|
21
21
|
if len(gpu_devices) == 0:
|
22
22
|
self.__handleNonePciDevices()
|
23
23
|
else:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from .gpuInfo import GPUInfo
|
2
|
-
import
|
2
|
+
from ...pyhwUtil import PCIManager
|
3
3
|
|
4
4
|
|
5
5
|
class GPUDetectWindows:
|
@@ -12,7 +12,7 @@ class GPUDetectWindows:
|
|
12
12
|
return self.__gpuInfo
|
13
13
|
|
14
14
|
def __getGPUInfo(self):
|
15
|
-
gpu_devices =
|
15
|
+
gpu_devices = PCIManager.get_instance().FindAllVGA()
|
16
16
|
if len(gpu_devices) == 0:
|
17
17
|
self.__handleNonePciDevices()
|
18
18
|
else:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import subprocess
|
2
2
|
from .nicInfo import NICInfo
|
3
|
-
import
|
3
|
+
from ...pyhwUtil import PCIManager
|
4
4
|
import os
|
5
5
|
|
6
6
|
|
@@ -14,7 +14,7 @@ class NICDetectLinux:
|
|
14
14
|
return self._nicInfo
|
15
15
|
|
16
16
|
def _getNICInfo(self):
|
17
|
-
nic_devices =
|
17
|
+
nic_devices = PCIManager.get_instance().FindAllNIC()
|
18
18
|
if len(nic_devices) == 0:
|
19
19
|
self.__handleNonePciDevices()
|
20
20
|
else:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from .nicInfo import NICInfo
|
2
|
-
import
|
2
|
+
from ...pyhwUtil import PCIManager
|
3
3
|
|
4
4
|
|
5
5
|
class NICDetectWindows:
|
@@ -12,7 +12,7 @@ class NICDetectWindows:
|
|
12
12
|
return self._nicInfo
|
13
13
|
|
14
14
|
def _getNICInfo(self):
|
15
|
-
nic_devices =
|
15
|
+
nic_devices = PCIManager.get_instance().FindAllNIC()
|
16
16
|
if len(nic_devices) == 0:
|
17
17
|
self.__handleNonePciDevices()
|
18
18
|
else:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from .npuInfo import NPUInfo
|
2
|
-
import
|
2
|
+
from ...pyhwUtil import PCIManager
|
3
3
|
import os
|
4
4
|
|
5
5
|
|
@@ -13,7 +13,7 @@ class NPUDetectLinux:
|
|
13
13
|
return self._npuInfo
|
14
14
|
|
15
15
|
def _getNPUInfo(self):
|
16
|
-
npu_devices =
|
16
|
+
npu_devices = PCIManager.get_instance().FindAllNPU()
|
17
17
|
if len(npu_devices) == 0:
|
18
18
|
self._handleNonePciDevices()
|
19
19
|
else:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from .npuInfo import NPUInfo
|
2
|
-
import
|
2
|
+
from ...pyhwUtil import PCIManager
|
3
3
|
|
4
4
|
|
5
5
|
class NPUDetectWindows:
|
@@ -12,7 +12,7 @@ class NPUDetectWindows:
|
|
12
12
|
return self._npuInfo
|
13
13
|
|
14
14
|
def _getNPUInfo(self):
|
15
|
-
npu_devices =
|
15
|
+
npu_devices = PCIManager.get_instance().FindAllNPU()
|
16
16
|
if len(npu_devices) == 0:
|
17
17
|
self._handleNonePciDevices()
|
18
18
|
else:
|
@@ -0,0 +1,16 @@
|
|
1
|
+
from .pyhwUtil import getOS, getArch, getDocker, getWSL, createDataString, selectOSLogo
|
2
|
+
from .sysctlUtil import sysctlGetString, sysctlGetInt
|
3
|
+
from .cliUtil import ReleaseChecker
|
4
|
+
from .pciUtil import PCIManager
|
5
|
+
|
6
|
+
|
7
|
+
__all__ = ["getOS",
|
8
|
+
"getArch",
|
9
|
+
"getDocker",
|
10
|
+
"getWSL",
|
11
|
+
"createDataString",
|
12
|
+
"selectOSLogo",
|
13
|
+
"sysctlGetString",
|
14
|
+
"sysctlGetInt",
|
15
|
+
"ReleaseChecker",
|
16
|
+
"PCIManager"]
|
@@ -12,13 +12,16 @@ class ReleaseChecker:
|
|
12
12
|
"""
|
13
13
|
PACKAGE_NAME = "pyhw"
|
14
14
|
|
15
|
-
def __init__(self):
|
15
|
+
def __init__(self, only_local=False):
|
16
16
|
"""
|
17
17
|
Initialize the ReleaseChecker.
|
18
18
|
"""
|
19
19
|
self.isInPIPX = self.__is_running_in_pipx()
|
20
20
|
self.CurrentVersion = self.__get_installed_version()
|
21
|
-
|
21
|
+
if only_local:
|
22
|
+
self.LatestVersion = self.CurrentVersion
|
23
|
+
else:
|
24
|
+
self.LatestVersion = self.__get_latest_version()
|
22
25
|
|
23
26
|
@staticmethod
|
24
27
|
def __is_running_in_pipx():
|
@@ -124,6 +124,7 @@ src/pyhw/pyhwException/__init__.py
|
|
124
124
|
src/pyhw/pyhwException/pyhwException.py
|
125
125
|
src/pyhw/pyhwUtil/__init__.py
|
126
126
|
src/pyhw/pyhwUtil/cliUtil.py
|
127
|
+
src/pyhw/pyhwUtil/pciUtil.py
|
127
128
|
src/pyhw/pyhwUtil/pyhwUtil.py
|
128
129
|
src/pyhw/pyhwUtil/sysctlUtil.py
|
129
130
|
test/test_cliUtil.py
|
@@ -1,6 +0,0 @@
|
|
1
|
-
from .pyhwUtil import getOS, getArch, getDocker, getWSL, createDataString, selectOSLogo
|
2
|
-
from .sysctlUtil import sysctlGetString, sysctlGetInt
|
3
|
-
from .cliUtil import ReleaseChecker
|
4
|
-
|
5
|
-
|
6
|
-
__all__ = ["getOS", "getArch", "getDocker", "getWSL", "createDataString", "selectOSLogo", "sysctlGetString", "sysctlGetInt", "ReleaseChecker"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|