pyhw 0.14.3__py3-none-any.whl → 0.14.5__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 +1 -1
- pyhw/__main__.py +1 -1
- pyhw/backend/nic/macos.py +10 -11
- {pyhw-0.14.3.dist-info → pyhw-0.14.5.dist-info}/METADATA +1 -1
- {pyhw-0.14.3.dist-info → pyhw-0.14.5.dist-info}/RECORD +9 -9
- {pyhw-0.14.3.dist-info → pyhw-0.14.5.dist-info}/WHEEL +0 -0
- {pyhw-0.14.3.dist-info → pyhw-0.14.5.dist-info}/entry_points.txt +0 -0
- {pyhw-0.14.3.dist-info → pyhw-0.14.5.dist-info}/licenses/LICENSE +0 -0
- {pyhw-0.14.3.dist-info → pyhw-0.14.5.dist-info}/top_level.txt +0 -0
pyhw/__init__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = '0.14.
|
1
|
+
__version__ = '0.14.5'
|
2
2
|
__author__ = 'xiaoran007'
|
pyhw/__main__.py
CHANGED
@@ -161,7 +161,7 @@ def main():
|
|
161
161
|
processes.append(multiprocessing.Process(target=detect_nic, args=(debug_info, current_os, result_dict)))
|
162
162
|
processes.append(multiprocessing.Process(target=detect_npu, args=(debug_info, current_os, result_dict)))
|
163
163
|
else:
|
164
|
-
multiprocessing.Process(target=detect_pci_related, args=(debug_info, current_os, result_dict))
|
164
|
+
processes.append(multiprocessing.Process(target=detect_pci_related, args=(debug_info, current_os, result_dict)))
|
165
165
|
|
166
166
|
start_time = time.time()
|
167
167
|
for process in processes:
|
pyhw/backend/nic/macos.py
CHANGED
@@ -72,7 +72,7 @@ class NICDetectMacOS:
|
|
72
72
|
wifi_standard):
|
73
73
|
|
74
74
|
if is_wifi.value:
|
75
|
-
conn_info = f"{conn_type.value.decode('utf-8')}
|
75
|
+
conn_info = f"{conn_type.value.decode('utf-8')} ({wifi_standard.value.decode('utf-8')} {band.value.decode('utf-8')} {speed.value} Mbps)"
|
76
76
|
else:
|
77
77
|
conn_info = conn_type.value.decode('utf-8')
|
78
78
|
|
@@ -92,7 +92,6 @@ class NICDetectMacOS:
|
|
92
92
|
# print(f"An error occurred while getting NIC info using IOKit: {e}")
|
93
93
|
return False
|
94
94
|
|
95
|
-
|
96
95
|
def __getLinkInfo(self, interface):
|
97
96
|
try:
|
98
97
|
# Check if interface is wireless
|
@@ -141,7 +140,7 @@ class NICDetectMacOS:
|
|
141
140
|
return "Unknown connection type"
|
142
141
|
|
143
142
|
def __getWifiInfo(self, interface):
|
144
|
-
#
|
143
|
+
# Use system_profiler to get WiFi information
|
145
144
|
profiler_cmd = f"system_profiler SPAirPortDataType -json"
|
146
145
|
try:
|
147
146
|
wifi_data = subprocess.run(["bash", "-c", profiler_cmd],
|
@@ -150,27 +149,27 @@ class NICDetectMacOS:
|
|
150
149
|
import json
|
151
150
|
data = json.loads(wifi_data)
|
152
151
|
|
153
|
-
#
|
152
|
+
# Extract information based on the JSON structure
|
154
153
|
if 'SPAirPortDataType' in data and isinstance(data['SPAirPortDataType'], list):
|
155
154
|
airport_data = data['SPAirPortDataType'][0]
|
156
155
|
|
157
|
-
#
|
156
|
+
# Get the interface list
|
158
157
|
if 'spairport_airport_interfaces' in airport_data:
|
159
158
|
interfaces = airport_data['spairport_airport_interfaces']
|
160
159
|
|
161
|
-
#
|
160
|
+
# Find the matching interface
|
162
161
|
for iface in interfaces:
|
163
162
|
if interface == iface.get('_name', ''):
|
164
|
-
#
|
163
|
+
# Get current network information
|
165
164
|
current_network = iface.get('spairport_current_network_information', {})
|
166
165
|
|
167
|
-
#
|
166
|
+
# Extract speed rate from current connection
|
168
167
|
speed = current_network.get('spairport_network_rate', 'Unknown')
|
169
168
|
|
170
|
-
#
|
169
|
+
# Get channel information
|
171
170
|
channel_info = current_network.get('spairport_network_channel', 'Unknown')
|
172
171
|
|
173
|
-
#
|
172
|
+
# Determine frequency band information
|
174
173
|
band = "Unknown"
|
175
174
|
if isinstance(channel_info, str) and "GHz" in channel_info:
|
176
175
|
if "2GHz" in channel_info:
|
@@ -184,7 +183,7 @@ class NICDetectMacOS:
|
|
184
183
|
|
185
184
|
return "Unknown", "Unknown", "Unknown"
|
186
185
|
except Exception as e:
|
187
|
-
#
|
186
|
+
# Consider adding logging here: print(f"WiFi info error: {str(e)}")
|
188
187
|
return "Unknown", "Unknown", "Unknown"
|
189
188
|
|
190
189
|
def __handleError(self):
|
@@ -1,5 +1,5 @@
|
|
1
|
-
pyhw/__init__.py,sha256=
|
2
|
-
pyhw/__main__.py,sha256=
|
1
|
+
pyhw/__init__.py,sha256=eOxuhwFyuQwwWYirX6ntuseKmudSsXz39a-J3PvVEx0,49
|
2
|
+
pyhw/__main__.py,sha256=sycXv_HBzXuNET2w0-fRgMwHaWIsMALyJ_ZCxdZulDk,7696
|
3
3
|
pyhw/backend/__init__.py,sha256=X1D1D28lSojDrUzUolgJvmbuctwBh_UxG3FwUeL8adA,51
|
4
4
|
pyhw/backend/backendBase.py,sha256=mloo8mPEbgbIdmyQ3I4vdEXMSSjxWi_wnwACmzvHbEo,506
|
5
5
|
pyhw/backend/cpu/__init__.py,sha256=5YfANJVRwNwTRodG0ENOgusrdN592aaSnfq5ok4dKTo,56
|
@@ -38,7 +38,7 @@ pyhw/backend/memory/windows.py,sha256=ISihGHBnV8iD4Xj8_kelFSCydPu05CYKxG5q_wM5Zb
|
|
38
38
|
pyhw/backend/nic/__init__.py,sha256=eP4eOYIvMF3LcTf954hJa6TnB8R4Qahss2g-UcgypKY,57
|
39
39
|
pyhw/backend/nic/bsd.py,sha256=6nj7XXII5dRz3FGRYAXVgTt0vSgyQo0Re9JA1vlcnuw,134
|
40
40
|
pyhw/backend/nic/linux.py,sha256=e6gX58RBE9IDKb0FrzZ7U2EhDNfGJsR6OvXq6qO5ZOc,2003
|
41
|
-
pyhw/backend/nic/macos.py,sha256=
|
41
|
+
pyhw/backend/nic/macos.py,sha256=C0sfNQ1V1peeZzt3JTKqY1Gq_ATsLjsA-HKCnIZcLTs,8623
|
42
42
|
pyhw/backend/nic/nicBase.py,sha256=Kng5qoe7FHcnQaf6S-LUe_HyOaBJe0L1SVstdIQ_WJY,962
|
43
43
|
pyhw/backend/nic/nicInfo.py,sha256=wuBuL-aIzD441IUDPGz5e0xctcZ-opdpgqkVxgbvZLg,133
|
44
44
|
pyhw/backend/nic/windows.py,sha256=4yJ0pmiXokegLEC299WLwqiW9uHAgaiVpkR2vCuzECg,1225
|
@@ -121,9 +121,9 @@ pyhw/pyhwUtil/cliUtil.py,sha256=IUcWun5nDwQb20Qe8YefS5j3Jji8a-F41Qd9QwCf0h0,2454
|
|
121
121
|
pyhw/pyhwUtil/pciUtil.py,sha256=WAluDRDb-gUbqhvSIusFzPrf6r98EkrNEAwbPyMwrTc,202
|
122
122
|
pyhw/pyhwUtil/pyhwUtil.py,sha256=V3M6X9eTirwnwwRiSJaLUWrZKZYMbRihARJVQc879P8,8364
|
123
123
|
pyhw/pyhwUtil/sysctlUtil.py,sha256=S-rUvqi7ZrMyMouIhxlyHEQ4agM7sCT1Y7uzs3Hu5-o,841
|
124
|
-
pyhw-0.14.
|
125
|
-
pyhw-0.14.
|
126
|
-
pyhw-0.14.
|
127
|
-
pyhw-0.14.
|
128
|
-
pyhw-0.14.
|
129
|
-
pyhw-0.14.
|
124
|
+
pyhw-0.14.5.dist-info/licenses/LICENSE,sha256=hJs6RBqSVCexbTsalkMLNFI5t06kekQEsSVaOt_-yLs,1497
|
125
|
+
pyhw-0.14.5.dist-info/METADATA,sha256=LgISYuP-YhcMDbS9rhmgwWFXFHNvHEpeDZuQnd_LmM8,7715
|
126
|
+
pyhw-0.14.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
127
|
+
pyhw-0.14.5.dist-info/entry_points.txt,sha256=q-AB8im_QahpmNrmy4aPTJRGi0LlbNlnI3kF7s6pKss,44
|
128
|
+
pyhw-0.14.5.dist-info/top_level.txt,sha256=7Inxvxt1TngEricKZEex9_WJZS3DbKYFUXDz4v5WHYU,5
|
129
|
+
pyhw-0.14.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|