提交 ca8e2c3a 编写于 作者: N nicolargo

Add compatibility for Py-cpuinfo 7.0.0 or higher

上级 cce7d6a4
......@@ -99,8 +99,12 @@ class Plugin(GlancesPlugin):
stats['cpu_name'] = cpu_info.get('brand', 'CPU')
if 'hz_actual_raw' in cpu_info:
stats['cpu_hz_current'] = cpu_info['hz_actual_raw'][0]
elif 'hz_actual' in cpu_info:
stats['cpu_hz_current'] = cpu_info['hz_actual'][0]
if 'hz_advertised_raw' in cpu_info:
stats['cpu_hz'] = cpu_info['hz_advertised_raw'][0]
elif 'hz_advertised' in cpu_info:
stats['cpu_hz'] = cpu_info['hz_advertised'][0]
# Update the stats
self.stats = stats
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册