提交 4c78d5f1 编写于 作者: N Nicolargo

Try/catch for issue #356

上级 2c57f019
......@@ -19,7 +19,7 @@
# Glances informations
__appname__ = 'glances'
__version__ = '2.0_RC1'
__version__ = '2.0_RC2'
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
__license__ = 'LGPL'
......
......@@ -133,7 +133,10 @@ class Plugin(GlancesPlugin):
ret.append(self.curse_add_line(msg))
msg = "{0:>5}".format(item['value'])
if item['type'] == 'battery':
ret.append(self.curse_add_line(msg, self.get_alert(100 - item['value'], header=item['type'])))
try:
ret.append(self.curse_add_line(msg, self.get_alert(100 - item['value'], header=item['type'])))
except TypeError:
pass
else:
ret.append(self.curse_add_line(msg, self.get_alert(item['value'], header=item['type'])))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册