pyhw 0.13.2__tar.gz → 0.13.3__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.2/src/pyhw.egg-info → pyhw-0.13.3}/PKG-INFO +3 -1
- {pyhw-0.13.2 → pyhw-0.13.3}/README.md +2 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/pyproject.toml +1 -1
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/__init__.py +1 -1
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/cpu/linux.py +14 -1
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/cpu/macos.py +21 -2
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/gpu/linux.py +4 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/host/linux.py +1 -1
- pyhw-0.13.3/src/pyhw/library/lib/iokitCPULib.dylib +0 -0
- pyhw-0.13.3/src/pyhw/library/test/iokitCPULibTest.py +15 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/pyhwUtil/pyhwUtil.py +8 -6
- {pyhw-0.13.2 → pyhw-0.13.3/src/pyhw.egg-info}/PKG-INFO +3 -1
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw.egg-info/SOURCES.txt +1 -0
- pyhw-0.13.2/src/pyhw/library/lib/iokitCPULib.dylib +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/LICENSE +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/setup.cfg +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/__main__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/backendBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/cpu/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/cpu/bsd.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/cpu/cpuBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/cpu/cpuInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/cpu/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/gpu/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/gpu/bsd.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/gpu/gpuBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/gpu/gpuInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/gpu/macos.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/gpu/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/host/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/host/bsd.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/host/hostBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/host/hostInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/host/macos.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/host/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/kernel/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/kernel/kernelBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/kernel/kernelInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/kernel/unix.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/kernel/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/memory/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/memory/bsd.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/memory/linux.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/memory/macos.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/memory/memoryBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/memory/memoryInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/memory/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/nic/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/nic/bsd.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/nic/linux.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/nic/macos.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/nic/nicBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/nic/nicInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/nic/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/npu/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/npu/bsd.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/npu/linux.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/npu/macos.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/npu/npuBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/npu/npuInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/npu/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/os/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/os/bsd.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/os/linux.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/os/macos.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/os/osBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/os/osInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/os/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/shell/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/shell/shellBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/shell/shellInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/shell/unix.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/shell/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/title/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/title/titleBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/title/titleInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/title/unix.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/title/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/uptime/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/uptime/bsd.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/uptime/linux.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/uptime/macos.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/uptime/uptimeBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/uptime/uptimeInfo.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/backend/uptime/windows.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/color/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/color/colorConfig.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/color/colorSet.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/color/colorUtil.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/frontendBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/alpine.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/arch.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/armbian.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/centos.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/debian.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/fedora.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/fedora_small.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/freebsd.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/kali.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/linux.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/linuxmint.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/macOS.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/opensuse-leap.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/opensuse-tumbleweed.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/raspbian.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/rhel.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/ubuntu.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/ubuntu_small.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/windows_10.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/windows_11.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/windows_2025.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/ascii/windows_old.pyhw +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/frontend/logo/logoBase.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/library/lib/iokitGPULib.dylib +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/library/lib/iokitHostLib.dylib +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/library/lib/nvmlGPULib_amd64.so +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/library/lib/nvmlGPULib_arm64.so +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/library/test/iokitHostLibTest.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/library/test/nvmlGPULibTest.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/pyhwException/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/pyhwException/pyhwException.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/pyhwUtil/__init__.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/pyhwUtil/cliUtil.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw/pyhwUtil/sysctlUtil.py +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw.egg-info/dependency_links.txt +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw.egg-info/entry_points.txt +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw.egg-info/requires.txt +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/src/pyhw.egg-info/top_level.txt +0 -0
- {pyhw-0.13.2 → pyhw-0.13.3}/test/test_cliUtil.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pyhw
|
3
|
-
Version: 0.13.
|
3
|
+
Version: 0.13.3
|
4
4
|
Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
|
5
5
|
Author: Xiao Ran
|
6
6
|
Maintainer-email: Xiao Ran <xiaoran.007@icloud.com>
|
@@ -30,6 +30,8 @@ Dynamic: license-file
|
|
30
30
|

|
31
31
|

|
32
32
|

|
33
|
+

|
34
|
+

|
33
35
|
|
34
36
|
|
35
37
|
PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python.
|
@@ -12,6 +12,8 @@
|
|
12
12
|

|
13
13
|

|
14
14
|

|
15
|
+

|
16
|
+

|
15
17
|
|
16
18
|
|
17
19
|
PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python.
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "pyhw"
|
7
|
-
version = "0.13.
|
7
|
+
version = "0.13.3"
|
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.13.
|
1
|
+
__version__ = '0.13.3'
|
2
2
|
__author__ = 'xiaoran007'
|
@@ -48,7 +48,20 @@ class CPUDetectLinux:
|
|
48
48
|
else:
|
49
49
|
for line in cpu_info.split("\n"):
|
50
50
|
if line.startswith("cpu MHz") or line.startswith("clock"):
|
51
|
-
|
51
|
+
value_str = line.split(':')[1].strip()
|
52
|
+
try:
|
53
|
+
freq_value = float(value_str)
|
54
|
+
self.__cpuInfo.frequency = f"{round(freq_value / 1000, 2)} Ghz"
|
55
|
+
except ValueError:
|
56
|
+
match = re.search(r'(\d+(?:\.\d+)?)', value_str)
|
57
|
+
if match:
|
58
|
+
freq_value = float(match.group(1))
|
59
|
+
if 'MHz' in value_str:
|
60
|
+
self.__cpuInfo.frequency = f"{round(freq_value / 1000, 2)} Ghz"
|
61
|
+
elif 'GHz' in value_str:
|
62
|
+
self.__cpuInfo.frequency = f"{round(freq_value, 2)} Ghz"
|
63
|
+
else:
|
64
|
+
self.__cpuInfo.frequency = f"{round(freq_value / 1000, 2)} Ghz"
|
52
65
|
break
|
53
66
|
|
54
67
|
def __modelClean(self):
|
@@ -1,5 +1,7 @@
|
|
1
1
|
from .cpuInfo import CPUInfo
|
2
2
|
from ...pyhwUtil import sysctlGetString, sysctlGetInt, getArch
|
3
|
+
import ctypes
|
4
|
+
from pathlib import Path
|
3
5
|
|
4
6
|
|
5
7
|
class CPUDetectMacOS:
|
@@ -11,11 +13,13 @@ class CPUDetectMacOS:
|
|
11
13
|
|
12
14
|
def getCPUInfo(self):
|
13
15
|
if self.__arch == "aarch64":
|
16
|
+
# For Apple Silicon Macs, we need to handle the CPU differently.
|
14
17
|
self.__getCPUModel()
|
15
|
-
self.
|
18
|
+
self.__AppleSiliconIOKitFrequency()
|
16
19
|
self.__handleAppleSilicon()
|
17
20
|
self.__cpuInfo.cpu = f"{self.__cpuInfo.model} ({self.__pCore}P, {self.__eCore}E) @ {self.__cpuInfo.frequency}"
|
18
21
|
else:
|
22
|
+
# For Intel Macs, we can use sysctl to get the CPU information.
|
19
23
|
self.__getCPUModel()
|
20
24
|
self.__getCPUCores()
|
21
25
|
self.__getCPUFrequency()
|
@@ -50,6 +54,21 @@ class CPUDetectMacOS:
|
|
50
54
|
self.__pCore = pcore
|
51
55
|
self.__eCore = ecore
|
52
56
|
|
57
|
+
def __AppleSiliconIOKitFrequency(self):
|
58
|
+
try:
|
59
|
+
package_root = Path(__file__).resolve().parent.parent.parent
|
60
|
+
lib = ctypes.CDLL(f"{package_root}/library/lib/iokitCPULib.dylib")
|
61
|
+
lib.get_apple_silicon_max_frequency.restype = ctypes.c_double
|
62
|
+
max_freq = lib.get_apple_silicon_max_frequency()
|
63
|
+
if max_freq != 0:
|
64
|
+
self.__cpuInfo.frequency = f"{max_freq:.2f} GHz"
|
65
|
+
else:
|
66
|
+
# If the IOKit library fails, we can fallback to the base frequency.
|
67
|
+
self.__AppleSiliconBaseFrequency()
|
68
|
+
except Exception as e:
|
69
|
+
# If the IOKit library fails, we can fallback to the base frequency.
|
70
|
+
self.__AppleSiliconBaseFrequency()
|
71
|
+
|
53
72
|
def __AppleSiliconBaseFrequency(self):
|
54
73
|
# see https://en.wikipedia.org/wiki/Apple_silicon#M_series for more details.
|
55
74
|
# https://eclecticlight.co/2025/01/20/what-are-cpu-core-frequencies-in-apple-silicon-macs/
|
@@ -66,7 +85,7 @@ class CPUDetectMacOS:
|
|
66
85
|
"Apple M3 Pro": "4.05 GHz",
|
67
86
|
"Apple M3 Max": "4.05 GHz",
|
68
87
|
"Apple M3 Ultra": "4.05 GHz", # Need more info
|
69
|
-
"Apple M4": "4.
|
88
|
+
"Apple M4": "4.46 GHz",
|
70
89
|
"Apple M4 Pro": "4.51 GHz",
|
71
90
|
"Apple M4 Max": "4.51 GHz"
|
72
91
|
}
|
@@ -39,6 +39,10 @@ class GPUDetectLinux:
|
|
39
39
|
device_name = f"{device.vendor_name} {device.device_name} [{device.subsystem_device_name}] {core_print}"
|
40
40
|
else:
|
41
41
|
device_name = f"{device.vendor_name} {device.device_name} {core_print}"
|
42
|
+
|
43
|
+
if not device_name.strip():
|
44
|
+
device_name = f"{device.class_name}"
|
45
|
+
|
42
46
|
self.__gpuInfo.gpus.append(self.__gpuNameClean(device_name))
|
43
47
|
self.__gpuInfo.number += 1
|
44
48
|
|
@@ -41,7 +41,7 @@ class HostDetectLinux:
|
|
41
41
|
self._hostInfo.model = self._hostInfo.name + " " + self._hostInfo.version
|
42
42
|
except FileNotFoundError:
|
43
43
|
pass
|
44
|
-
elif self._arch in ["aarch64", "arm32", "riscv64"]:
|
44
|
+
elif self._arch in ["aarch64", "arm32", "riscv64", "ppc64le", "mips64"]:
|
45
45
|
# try to find dmi folder since some arm based desktops and servers may have same structure as x86_64 machines.
|
46
46
|
if os.path.exists("/sys/devices/virtual/dmi/id"):
|
47
47
|
try:
|
Binary file
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import ctypes
|
2
|
+
|
3
|
+
|
4
|
+
def main():
|
5
|
+
lib = ctypes.CDLL(f"../lib/iokitCPULib.dylib")
|
6
|
+
lib.get_apple_silicon_max_frequency.restype = ctypes.c_double
|
7
|
+
max_freq = lib.get_apple_silicon_max_frequency()
|
8
|
+
print(max_freq)
|
9
|
+
# gpus = host_info.decode('utf-8').split("; ")
|
10
|
+
|
11
|
+
|
12
|
+
if __name__ == "__main__":
|
13
|
+
main()
|
14
|
+
|
15
|
+
|
@@ -5,7 +5,7 @@ from dataclasses import dataclass
|
|
5
5
|
import subprocess
|
6
6
|
|
7
7
|
|
8
|
-
def getOS():
|
8
|
+
def getOS() -> str:
|
9
9
|
"""
|
10
10
|
Get the os type in lower case.
|
11
11
|
:return: str, os type, value in [windows, linux, macos, freebsd, unknown].
|
@@ -23,10 +23,10 @@ def getOS():
|
|
23
23
|
return "unknown"
|
24
24
|
|
25
25
|
|
26
|
-
def getArch():
|
26
|
+
def getArch() -> str:
|
27
27
|
"""
|
28
28
|
Get the machine architecture.
|
29
|
-
:return: str, value in [x86_64, x86, aarch64, arm32, riscv64, s390x, ppc64le].
|
29
|
+
:return: str, value in [x86_64, x86, aarch64, arm32, riscv64, s390x, ppc64le, mips64].
|
30
30
|
"""
|
31
31
|
arch = platform.machine()
|
32
32
|
if arch == "x86_64" or arch == "AMD64" or arch == "amd64":
|
@@ -43,6 +43,8 @@ def getArch():
|
|
43
43
|
return "s390x"
|
44
44
|
elif arch == "ppc64le":
|
45
45
|
return "ppc64le"
|
46
|
+
elif arch == "mips64":
|
47
|
+
return "mips64"
|
46
48
|
else:
|
47
49
|
return "unknown"
|
48
50
|
|
@@ -157,7 +159,7 @@ class DataStringProcessor:
|
|
157
159
|
return ret_str
|
158
160
|
|
159
161
|
|
160
|
-
def createDataString(data: Data):
|
162
|
+
def createDataString(data: Data) -> str:
|
161
163
|
data_string_processor = DataStringProcessor(data)
|
162
164
|
data_string = ""
|
163
165
|
data_string += data_string_processor.getTitle()
|
@@ -175,7 +177,7 @@ def createDataString(data: Data):
|
|
175
177
|
return data_string
|
176
178
|
|
177
179
|
|
178
|
-
def createDataStringOld(data: Data):
|
180
|
+
def createDataStringOld(data: Data) -> str:
|
179
181
|
data_string = ""
|
180
182
|
data_string += f" {data.title}\n"
|
181
183
|
data_string += f" {'-'*len(data.title)}\n"
|
@@ -195,7 +197,7 @@ def createDataStringOld(data: Data):
|
|
195
197
|
return data_string
|
196
198
|
|
197
199
|
|
198
|
-
def selectOSLogo(os_id: str):
|
200
|
+
def selectOSLogo(os_id: str) -> str:
|
199
201
|
"""
|
200
202
|
Select the logo based on the os id and terminal size.
|
201
203
|
:param os_id: str, os id.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pyhw
|
3
|
-
Version: 0.13.
|
3
|
+
Version: 0.13.3
|
4
4
|
Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
|
5
5
|
Author: Xiao Ran
|
6
6
|
Maintainer-email: Xiao Ran <xiaoran.007@icloud.com>
|
@@ -30,6 +30,8 @@ Dynamic: license-file
|
|
30
30
|

|
31
31
|

|
32
32
|

|
33
|
+

|
34
|
+

|
33
35
|
|
34
36
|
|
35
37
|
PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python.
|
@@ -117,6 +117,7 @@ src/pyhw/library/lib/iokitGPULib.dylib
|
|
117
117
|
src/pyhw/library/lib/iokitHostLib.dylib
|
118
118
|
src/pyhw/library/lib/nvmlGPULib_amd64.so
|
119
119
|
src/pyhw/library/lib/nvmlGPULib_arm64.so
|
120
|
+
src/pyhw/library/test/iokitCPULibTest.py
|
120
121
|
src/pyhw/library/test/iokitHostLibTest.py
|
121
122
|
src/pyhw/library/test/nvmlGPULibTest.py
|
122
123
|
src/pyhw/pyhwException/__init__.py
|
Binary file
|
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
|
File without changes
|