pyhw 0.11.6__py3-none-any.whl → 0.11.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.
pyhw/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.11.6'
1
+ __version__ = '0.11.8'
@@ -26,7 +26,7 @@ class HostDetectLinux:
26
26
  try:
27
27
  with open("/sys/devices/virtual/dmi/id/product_name", "r") as f:
28
28
  product_name = f.read().strip()
29
- if product_name.startswith("To be filled by O.E.M."):
29
+ if product_name.startswith("To be filled by O.E.M.") or product_name.startswith("Default string"):
30
30
  self._hostInfo.name = f"General {self._arch} Host"
31
31
  else:
32
32
  self._hostInfo.name = product_name
@@ -1,11 +1,25 @@
1
1
  from .linux import MemoryDetectLinux
2
+ from ...pyhwUtil import sysctlGetInt
2
3
 
3
4
 
4
5
  class MemoryDetectBSD(MemoryDetectLinux):
5
6
  def __init__(self):
6
7
  MemoryDetectLinux.__init__(self)
8
+ self.__page_size = 0
9
+ self.__physical_memory = 0
10
+ self.__free_pages = 0
11
+ self.__free_memory = 0
7
12
 
8
13
  def getMemoryInfo(self):
9
- self._memoryInfo.memory = f"Pass"
14
+ self.__getMemorySysctl()
15
+ self._memoryInfo.total = self.__physical_memory / 1024 / 1024 # Convert bytes to MiB
16
+ self._memoryInfo.used = (self.__physical_memory - self.__free_memory) / 1024 / 1024 # Convert bytes to MiB
17
+ self._memoryInfo.memory = f"{round(self._memoryInfo.used, 2)} MiB / {round(self._memoryInfo.total, 2)} MiB"
10
18
  return self._memoryInfo
11
19
 
20
+ def __getMemorySysctl(self):
21
+ self.__page_size = sysctlGetInt("hw.pagesize")
22
+ self.__physical_memory = sysctlGetInt("hw.physmem")
23
+ self.__free_pages = sysctlGetInt("vm.stats.vm.v_free_count")
24
+ self.__free_memory = self.__free_pages * self.__page_size
25
+
pyhw/backend/npu/macos.py CHANGED
@@ -46,20 +46,20 @@ class NPUDetectMacOS:
46
46
  # see https://apple.fandom.com/wiki/Neural_Engine for more details.
47
47
  model_name = CPUDetect(os=getOS()).getCPUInfo().model
48
48
  npu = {
49
- "Apple M1": "Apple Neural Engine 16 Cores (5 nm) [SOC Integrated]",
50
- "Apple M1 Pro": "Apple Neural Engine 16 Cores (5 nm) [SOC Integrated]",
51
- "Apple M1 Max": "Apple Neural Engine 16 Cores (5 nm) [SOC Integrated]",
52
- "Apple M1 Ultra": "Apple Neural Engine 32 Cores (5 nm) [SOC Integrated]",
53
- "Apple M2": "Apple Neural Engine 16 Cores (5 nm) [SOC Integrated]",
54
- "Apple M2 Pro": "Apple Neural Engine 16 Cores (5 nm) [SOC Integrated]",
55
- "Apple M2 Max": "Apple Neural Engine 16 Cores (5 nm) [SOC Integrated]",
56
- "Apple M2 Ultra": "Apple Neural Engine 32 Cores (5 nm) [SOC Integrated]",
57
- "Apple M3": "Apple Neural Engine 16 Cores (3 nm) [SOC Integrated]",
58
- "Apple M3 Pro": "Apple Neural Engine 16 Cores (3 nm) [SOC Integrated]",
59
- "Apple M3 Max": "Apple Neural Engine 16 Cores (3 nm) [SOC Integrated]",
60
- "Apple M4": "Apple Neural Engine 16 Cores (3 nm) [SOC Integrated]",
61
- "Apple M4 Pro": "Apple Neural Engine 16 Cores (3 nm) [SOC Integrated]",
62
- "Apple M4 Max": "Apple Neural Engine 16 Cores (3 nm) [SOC Integrated]"
49
+ "Apple M1": "Apple Neural Engine 16 Cores (5nm) [SOC Integrated]",
50
+ "Apple M1 Pro": "Apple Neural Engine 16 Cores (5nm) [SOC Integrated]",
51
+ "Apple M1 Max": "Apple Neural Engine 16 Cores (5nm) [SOC Integrated]",
52
+ "Apple M1 Ultra": "Apple Neural Engine 32 Cores (5nm) [SOC Integrated]",
53
+ "Apple M2": "Apple Neural Engine 16 Cores (5nm) [SOC Integrated]",
54
+ "Apple M2 Pro": "Apple Neural Engine 16 Cores (5nm) [SOC Integrated]",
55
+ "Apple M2 Max": "Apple Neural Engine 16 Cores (5nm) [SOC Integrated]",
56
+ "Apple M2 Ultra": "Apple Neural Engine 32 Cores (5nm) [SOC Integrated]",
57
+ "Apple M3": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]",
58
+ "Apple M3 Pro": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]",
59
+ "Apple M3 Max": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]",
60
+ "Apple M4": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]",
61
+ "Apple M4 Pro": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]",
62
+ "Apple M4 Max": "Apple Neural Engine 16 Cores (3nm) [SOC Integrated]"
63
63
  }
64
64
  return npu.get(model_name, "Not Found")
65
65
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyhw
3
- Version: 0.11.6
3
+ Version: 0.11.8
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>
@@ -1,4 +1,4 @@
1
- pyhw/__init__.py,sha256=tGnbKnxafgSWC1j3ohCpMaMVSG8meN6pcRsWJ6sINKE,23
1
+ pyhw/__init__.py,sha256=jcnaRLOloebxPmJzoiCEcFULMJYe9S5i13qB67zUiC8,23
2
2
  pyhw/__main__.py,sha256=oZpFtvSyYTM8cMsulvi51zJV0gtmw3OCQVdgoaHbtxc,4977
3
3
  pyhw/backend/__init__.py,sha256=knn_3Yroow1h0dqdrozk3zyy3vz-kQyNBRjR6OLmVoY,50
4
4
  pyhw/backend/backendBase.py,sha256=mloo8mPEbgbIdmyQ3I4vdEXMSSjxWi_wnwACmzvHbEo,506
@@ -20,7 +20,7 @@ pyhw/backend/host/__init__.py,sha256=Efaj7-Oya7H8HdpZHQCLrwn-mcfPb-d6yfh4dzsE_7I
20
20
  pyhw/backend/host/bsd.py,sha256=9gKnM6yysHBKwS3EQvb0pCeylh3dzHvoEuPe14zo9wQ,382
21
21
  pyhw/backend/host/hostBase.py,sha256=gM49SY6rEaxec_0bUOMk7QlEfR7vjfWp3BXEUqgdncc,762
22
22
  pyhw/backend/host/hostInfo.py,sha256=grz15M2t3f_enqQvc7Qn6HlEfYwa66bu2NYvm8VpJ-g,452
23
- pyhw/backend/host/linux.py,sha256=alqNkp-yn7xoVXcQXxvJFXVOv7azvu3_4QQi-3P7s8g,2835
23
+ pyhw/backend/host/linux.py,sha256=B7H8p37_BYvfhyq8g-zqKQbsIcO2kjeKBGwrJWY3tsY,2880
24
24
  pyhw/backend/host/macos.py,sha256=KW-EJK9g1xHNrFsVxJv5GPLpc_ZevX0Zv1WjZUzRkzo,15369
25
25
  pyhw/backend/host/windows.py,sha256=qn2QiTK2wIijyyw_QKdiSizY3teyS-9RNBu5RxEPRSw,1185
26
26
  pyhw/backend/kernel/__init__.py,sha256=fGjwjpOhwA_PnsWbwoq102hwhTay2ufYKaTqxjSV2-I,65
@@ -29,7 +29,7 @@ pyhw/backend/kernel/kernelInfo.py,sha256=Nkumd0McbimCjc7yJrvz6bcwpWu1Tdo_LKomjZr
29
29
  pyhw/backend/kernel/unix.py,sha256=XDV2GIjamERcmlrQFaKFZY-OJO1xj76Im_7lmg2uFzo,1192
30
30
  pyhw/backend/kernel/windows.py,sha256=MpY6S54VYQ_5l4f93GLOaXd4l-uIjg_k6AEYftkgvcc,1246
31
31
  pyhw/backend/memory/__init__.py,sha256=zGBWxfPAAk8ivCBWPLJIpuD-lB7wUJT3x8u2jHiAoCY,65
32
- pyhw/backend/memory/bsd.py,sha256=GKTCs6RocdoWj-5ZZRMB4xAWGWljor6leuwX-L-7bW0,251
32
+ pyhw/backend/memory/bsd.py,sha256=_Yv2W6T-h5ULqOQHp0dGYJvxPDzlPEkFiusYMKPxTHY,1014
33
33
  pyhw/backend/memory/linux.py,sha256=kxP0LxXdTWYRtu9nDyKqZeIzZrQI84kVOPMeN1GwSOo,917
34
34
  pyhw/backend/memory/macos.py,sha256=ur2HxmmmVkXmaxEcw_otphifVp_csfNMJdgt-idCq7M,2770
35
35
  pyhw/backend/memory/memoryBase.py,sha256=trubcJ_7JD_FnrKefUycPFd4OZMFj3Rk75ih5YVsSXg,790
@@ -46,7 +46,7 @@ pyhw/backend/nic/windows.py,sha256=c67JwHARtPxNsZ-0_MVKUfc7DwpsRVn7kiHdx_NyDn8,1
46
46
  pyhw/backend/npu/__init__.py,sha256=PgLKbwpgT5vw9xpa294Zxb94McyxNXW46_vMbT2Iqyc,58
47
47
  pyhw/backend/npu/bsd.py,sha256=eKkOWZ4MBybR_KOGGcsWUpzCGgghhvuBy5VNsnEE8cI,134
48
48
  pyhw/backend/npu/linux.py,sha256=fPsaXClSC-Py2kHRi17y4eGWrjwRDmjsIX4lgMxRVPc,1806
49
- pyhw/backend/npu/macos.py,sha256=qOIXfWILnA-sAKH6nq_cep7BlH0rKk4bglc1VgyKp6U,2625
49
+ pyhw/backend/npu/macos.py,sha256=QQxm9K6bmIdKLiaW7buNUZ_YOdfcEKz9mWPS5xVN2kY,2611
50
50
  pyhw/backend/npu/npuBase.py,sha256=1cVWRmr8g-mDXrJAx2cUO4qWZft2TtT7L2-HzRot2nI,748
51
51
  pyhw/backend/npu/npuInfo.py,sha256=82dK6XvW_XKw4O5-RfR4-qQRR7Plh8qqJLj0YDzISmU,135
52
52
  pyhw/backend/npu/windows.py,sha256=Z2v5CORSa1ap66k48G7uVLbon3zaoT4ug5sX2_rt6vM,1196
@@ -111,9 +111,9 @@ pyhw/pyhwUtil/__init__.py,sha256=34ygvVBBqfJ_9OMzHToCcV_BVahixNsa_Z5yh6VsaPQ,304
111
111
  pyhw/pyhwUtil/cliUtil.py,sha256=42Gdi9wTg5XOYuEvGHEgOaZJ6dJk1qSuHIprR8pCA-g,2344
112
112
  pyhw/pyhwUtil/pyhwUtil.py,sha256=RokrE7X99pkS0LtN4wyJS_ZQmjtMwiNxA7MwXMoO96c,7664
113
113
  pyhw/pyhwUtil/sysctlUtil.py,sha256=S-rUvqi7ZrMyMouIhxlyHEQ4agM7sCT1Y7uzs3Hu5-o,841
114
- pyhw-0.11.6.dist-info/LICENSE,sha256=hJs6RBqSVCexbTsalkMLNFI5t06kekQEsSVaOt_-yLs,1497
115
- pyhw-0.11.6.dist-info/METADATA,sha256=tyAe-kfwUGwwUM23D7NG8s2OqcNzOjKCr0Z7mNp-NGg,6753
116
- pyhw-0.11.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
117
- pyhw-0.11.6.dist-info/entry_points.txt,sha256=q-AB8im_QahpmNrmy4aPTJRGi0LlbNlnI3kF7s6pKss,44
118
- pyhw-0.11.6.dist-info/top_level.txt,sha256=7Inxvxt1TngEricKZEex9_WJZS3DbKYFUXDz4v5WHYU,5
119
- pyhw-0.11.6.dist-info/RECORD,,
114
+ pyhw-0.11.8.dist-info/LICENSE,sha256=hJs6RBqSVCexbTsalkMLNFI5t06kekQEsSVaOt_-yLs,1497
115
+ pyhw-0.11.8.dist-info/METADATA,sha256=EEeAejM_nQmGqONkUoDhJXCY1rD9OE4L3tbqOVv3cIE,6753
116
+ pyhw-0.11.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
117
+ pyhw-0.11.8.dist-info/entry_points.txt,sha256=q-AB8im_QahpmNrmy4aPTJRGi0LlbNlnI3kF7s6pKss,44
118
+ pyhw-0.11.8.dist-info/top_level.txt,sha256=7Inxvxt1TngEricKZEex9_WJZS3DbKYFUXDz4v5WHYU,5
119
+ pyhw-0.11.8.dist-info/RECORD,,
File without changes
File without changes