pyhw 0.14.4__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 CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = '0.14.4'
1
+ __version__ = '0.14.5'
2
2
  __author__ = 'xiaoran007'
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')} 802.11{wifi_standard.value.decode('utf-8')} ({band.value.decode('utf-8')} {speed.value} Mbps)"
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
- # 使用 system_profiler 获取 WiFi 信息
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
- # 根据实际 JSON 结构提取信息
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
- # 可以考虑添加日志记录 print(f"WiFi info error: {str(e)}")
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyhw
3
- Version: 0.14.4
3
+ Version: 0.14.5
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=Pt3AYgvOMt-i2dAXT2EwQj0cQvKE-E7vpvngWhXDPJ8,49
1
+ pyhw/__init__.py,sha256=eOxuhwFyuQwwWYirX6ntuseKmudSsXz39a-J3PvVEx0,49
2
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
@@ -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=AOT6IvgEGvWPIpv8UwlTGbFO7zaDDQn4xC1NL8SKmeo,8566
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.4.dist-info/licenses/LICENSE,sha256=hJs6RBqSVCexbTsalkMLNFI5t06kekQEsSVaOt_-yLs,1497
125
- pyhw-0.14.4.dist-info/METADATA,sha256=CtMPd6f1kjJMoYYeiSv_-OnmeqKFp12lcVHgSCEkp-Q,7715
126
- pyhw-0.14.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
127
- pyhw-0.14.4.dist-info/entry_points.txt,sha256=q-AB8im_QahpmNrmy4aPTJRGi0LlbNlnI3kF7s6pKss,44
128
- pyhw-0.14.4.dist-info/top_level.txt,sha256=7Inxvxt1TngEricKZEex9_WJZS3DbKYFUXDz4v5WHYU,5
129
- pyhw-0.14.4.dist-info/RECORD,,
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