提交 baa8ef1f 编写于 作者: A Alessio Sergi

Misc tweaks

- fix help screen
- whitespace before ‘:’
- missing whitespace around operator
- function name should be lowercase
- class names should use CapWords convention
- fix various misspelling
上级 5da624c2
......@@ -27,15 +27,15 @@ __license__ = 'LGPL'
# Import system lib
import gettext
import locale
import platform
import signal
import sys
import platform
# Import psutil
try:
from psutil import __version__ as __psutil_version
except ImportError:
print('psutil library not found. Glances cannot start.')
print('PSutil library not found. Glances cannot start.')
sys.exit(1)
# Import Glances libs
......
......@@ -27,7 +27,12 @@ try:
except ImportError:
netifaces_tag = True
try:
from zeroconf import ServiceBrowser, ServiceInfo, Zeroconf
from zeroconf import (
__version__ as __zeroconf_version,
ServiceBrowser,
ServiceInfo,
Zeroconf
)
zeroconf_tag = True
except ImportError:
zeroconf_tag = False
......@@ -35,15 +40,12 @@ except ImportError:
# Import Glances libs
from glances.core.glances_globals import appname, logger
# Need Zeroconf 0.16 or higher
try:
from zeroconf import __version__ as __zeroconf_version__
zeroconf_version_t = tuple([int(i) for i in __zeroconf_version__.split('.')])
logger.debug("Zeroconf Python lib %s detected" % __zeroconf_version__)
if (zeroconf_version_t[0] == 0) and (zeroconf_version_t[1] < 16):
logger.warning("Please install Zeroconf Python lib 0.16 or higher")
except ImportError:
pass
# Zeroconf 0.16 or higher is needed
zeroconf_min_version = (0, 16, 0)
zeroconf_version = tuple([int(num) for num in __zeroconf_version.split('.')])
logger.debug("Zeroconf library {0} detected.".format(__zeroconf_version))
if zeroconf_version < zeroconf_min_version:
logger.warning("Please install zeroconf 0.16 or higher.")
# Global var
zeroconf_type = "_%s._tcp." % appname
......@@ -92,7 +94,7 @@ class AutoDiscovered(object):
len(self._server_list), self._server_list))
except ValueError:
logger.error(
"Can not remove server %s from the list" % name)
"Cannot remove server %s from the list" % name)
class GlancesAutoDiscoverListener(object):
......@@ -151,7 +153,7 @@ class GlancesAutoDiscoverServer(object):
try:
self.zeroconf = Zeroconf()
except socket.error as e:
logger.error("Can not start Zeroconf (%s)" % e)
logger.error("Cannot start Zeroconf (%s)" % e)
self.zeroconf_enable_tag = False
else:
self.listener = GlancesAutoDiscoverListener()
......@@ -159,8 +161,7 @@ class GlancesAutoDiscoverServer(object):
self.zeroconf, zeroconf_type, self.listener)
self.zeroconf_enable_tag = True
else:
logger.error(
"Can not start autodiscover mode (Zeroconf lib is not installed)")
logger.error("Cannot start autodiscover mode (Zeroconf lib is not installed)")
self.zeroconf_enable_tag = False
def get_servers_list(self):
......@@ -200,7 +201,7 @@ class GlancesAutoDiscoverClient(object):
try:
self.zeroconf = Zeroconf()
except socket.error as e:
logger.error("Can not start Zeroconf (%s)" % e)
logger.error("Cannot start Zeroconf (%s)" % e)
else:
self.info = ServiceInfo(zeroconf_type,
hostname + ':' +
......@@ -215,10 +216,10 @@ class GlancesAutoDiscoverClient(object):
self.zeroconf.register_service(self.info)
else:
logger.error(
"Can not announce Glances server on the network (Zeroconf lib is not installed)")
"Cannot announce Glances server on the network (Zeroconf lib is not installed)")
else:
logger.error(
"Can not announce Glances server on the network (Netifaces lib is not installed)")
"Cannot announce Glances server on the network (Netifaces lib is not installed)")
def find_active_ip_address(self):
"""Try to find the active IP addresses"""
......
......@@ -214,7 +214,7 @@ class GlancesClient(object):
try:
self.stats.update()
except Exception:
# Client can not get SNMP server stats
# Client cannot get SNMP server stats
return "Disconnected"
else:
# Grab success
......
......@@ -127,7 +127,7 @@ class GlancesClientBrowser(object):
else:
v['status'] = 'OFFLINE'
logger.debug(
"Can not grab stats from {0}: {1}".format(uri, e))
"Cannot grab stats from {0}: {1}".format(uri, e))
else:
# Status
v['status'] = 'ONLINE'
......@@ -184,7 +184,7 @@ class GlancesClientBrowser(object):
# Test if client and server are in the same major version
if not client.login(return_to_browser=True):
self.screen.display_popup(_("Sorry, can not connect to %s (see log file for additional information)" % v['name']))
self.screen.display_popup(_("Sorry, cannot connect to %s (see log file for additional information)" % v['name']))
# Set the ONLINE status for the selected server
self.set_in_selected('status', 'OFFLINE')
......
......@@ -22,7 +22,7 @@
import os
import sys
from glances.core.glances_logging import glancesLogger
from glances.core.glances_logging import glances_logger
# Global information
appname = 'glances'
......@@ -63,7 +63,7 @@ sys_i18n_path = os.path.join(sys_prefix, 'share', 'locale')
locale_dir = get_locale_path([i18n_path, user_i18n_path, sys_i18n_path])
# Create and init the logging instance
logger = glancesLogger()
logger = glances_logger()
# Instances shared between all Glances scripts
# ============================================
......
......@@ -42,22 +42,22 @@ LOGGING_CFG = {
},
'handlers': {
'file': {
'level':'DEBUG',
'class':'logging.handlers.RotatingFileHandler',
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'formatter': 'standard',
# http://stackoverflow.com/questions/847850/cross-platform-way-of-getting-temp-directory-in-python
'filename': os.path.join(tempfile.gettempdir(), 'glances.log')
},
'console':{
'level':'CRITICAL',
'class':'logging.StreamHandler',
'console': {
'level': 'CRITICAL',
'class': 'logging.StreamHandler',
'formatter': 'short'
}
},
'loggers': {
'debug': {
'handlers':['file', 'console'],
'level':'DEBUG',
'handlers': ['file', 'console'],
'level': 'DEBUG',
},
'verbose': {
'handlers': ['file', 'console'],
......@@ -71,7 +71,7 @@ LOGGING_CFG = {
}
def glancesLogger():
def glances_logger():
_logger = logging.getLogger()
try:
logging.config.dictConfig(LOGGING_CFG)
......
......@@ -70,7 +70,7 @@ class ProcessTreeNode(object):
nodes_to_print.append(children_nodes_to_print)
return "\n".join(lines)
def setSorting(self, key, reverse):
def set_sorting(self, key, reverse):
""" Set sorting key or func for user with __iter__ (affects the whole tree from this node). """
if (self.sort_key != key) or (self.reverse_sorting != reverse):
nodes_to_flag_unsorted = collections.deque([self])
......@@ -81,7 +81,7 @@ class ProcessTreeNode(object):
current_node.reverse_sorting = reverse
nodes_to_flag_unsorted.extend(current_node.children)
def getWeight(self):
def get_weight(self):
""" Return "weight" of a process and all its children for sorting. """
if self.sort_key == "name":
return self.stats[self.sort_key]
......@@ -120,13 +120,13 @@ class ProcessTreeNode(object):
if not self.children_sorted:
# optimization to avoid sorting twice (once when limiting the maximum processes to grab stats for,
# and once before displaying)
self.children.sort(key=self.__class__.getWeight, reverse=self.reverse_sorting)
self.children.sort(key=self.__class__.get_weight, reverse=self.reverse_sorting)
self.children_sorted = True
for child in self.children:
for n in iter(child):
yield n
def iterChildren(self, exclude_incomplete_stats=True):
def iter_children(self, exclude_incomplete_stats=True):
"""
Iterator returning ProcessTreeNode in sorted order (only children of this node, non recursive).
......@@ -137,13 +137,13 @@ class ProcessTreeNode(object):
if not self.children_sorted:
# optimization to avoid sorting twice (once when limiting the maximum processes to grab stats for,
# and once before displaying)
self.children.sort(key=self.__class__.getWeight, reverse=self.reverse_sorting)
self.children.sort(key=self.__class__.get_weight, reverse=self.reverse_sorting)
self.children_sorted = True
for child in self.children:
if (not exclude_incomplete_stats) or ("time_since_update" in child.stats):
yield child
def findProcess(self, process):
def find_process(self, process):
""" Search in tree for the ProcessTreeNode owning process, return it or None if not found. """
nodes_to_search = collections.deque([self])
while nodes_to_search:
......@@ -153,7 +153,7 @@ class ProcessTreeNode(object):
nodes_to_search.extend(current_node.children)
@staticmethod
def buildTree(process_dict, sort_key, hide_kernel_threads):
def build_tree(process_dict, sort_key, hide_kernel_threads):
""" Build a process tree using using parent/child relationships, and return the tree root node. """
tree_root = ProcessTreeNode(root=True)
nodes_to_add_last = collections.deque()
......@@ -173,7 +173,7 @@ class ProcessTreeNode(object):
# parent is a kernel thread, add this node at the top level
tree_root.children.append(new_node)
else:
parent_node = tree_root.findProcess(parent_process)
parent_node = tree_root.find_process(parent_process)
if parent_node is not None:
# parent is already in the tree, add a new child
parent_node.children.append(new_node)
......@@ -195,7 +195,7 @@ class ProcessTreeNode(object):
# consider no parent, add this node at the top level
tree_root.children.append(node_to_add)
else:
parent_node = tree_root.findProcess(parent_process)
parent_node = tree_root.find_process(parent_process)
if parent_node is not None:
# parent is already in the tree, add a new child
parent_node.children.append(node_to_add)
......@@ -353,7 +353,7 @@ class GlancesProcesses(object):
# Correct issue #414
return None
if procstat['cpu_percent'] == '' or procstat['memory_percent'] == '':
# Do not display process if we can not get the basic
# Do not display process if we cannot get the basic
# cpu_percent or memory_percent stats
return None
......@@ -574,9 +574,9 @@ class GlancesProcesses(object):
pass
if self._enable_tree:
self.process_tree = ProcessTreeNode.buildTree(processdict,
self.getsortkey(),
self.no_kernel_threads)
self.process_tree = ProcessTreeNode.build_tree(processdict,
self.getsortkey(),
self.no_kernel_threads)
for i, node in enumerate(self.process_tree):
# Only retreive stats for visible processes (get_max_processes)
......@@ -604,7 +604,7 @@ class GlancesProcesses(object):
processiter = sorted(
processdict.items(), key=lambda x: x[1][self.getsortkey()], reverse=True)
except (KeyError, TypeError) as e:
logger.error("Can not sort process list by %s (%s)" % (self.getsortkey(), e))
logger.error("Cannot sort process list by %s (%s)" % (self.getsortkey(), e))
logger.error("%s" % str(processdict.items()[0]))
# Fallback to all process (issue #423)
processloop = processdict.items()
......@@ -674,7 +674,7 @@ class GlancesProcesses(object):
"""Set the current sort key for manual sort."""
self.processmanualsort = sortedby
if self._enable_tree and (self.process_tree is not None):
self.process_tree.setSorting(sortedby, sortedby != "name")
self.process_tree.set_sorting(sortedby, sortedby != "name")
return self.processmanualsort
def setautosortkey(self, sortedby):
......
......@@ -44,9 +44,9 @@ class GlancesStaticServer(object):
server_list = []
if config is None:
logger.warning("No configuration file available. Can not load server list.")
logger.warning("No configuration file available. Cannot load server list.")
elif not config.has_section(self._section):
logger.warning("No [%s] section in the configuration file. Can not load server list." % self._section)
logger.warning("No [%s] section in the configuration file. Cannot load server list." % self._section)
else:
logger.info("Start reading the [%s] section in the configuration file" % self._section)
for i in range(1, 256):
......@@ -64,7 +64,7 @@ class GlancesStaticServer(object):
try:
new_server['ip'] = gethostbyname(new_server['name'])
except gaierror as e:
logger.error("Can not get IP address for server %s (%s)" % (new_server['name'], e))
logger.error("Cannot get IP address for server %s (%s)" % (new_server['name'], e))
continue
new_server['key'] = new_server['name'] + ':' + new_server['port']
......
......@@ -254,7 +254,7 @@ class GlancesStatsClientSNMP(GlancesStats):
user=self.args.snmp_user,
auth=self.args.snmp_auth)
# If we can not grab the hostname, then exit...
# If we cannot grab the hostname, then exit...
ret = clientsnmp.get_by_oid("1.3.6.1.2.1.1.5.0") != {}
if ret:
# Get the OS name (need to grab the good OID...)
......@@ -281,7 +281,7 @@ class GlancesStatsClientSNMP(GlancesStats):
except AttributeError:
# Correct issue #386
iteritems = oid_to_short_system_name.items()
for r,v in iteritems:
for r, v in iteritems:
if re.search(r, oid_system_name):
short_system_name = v
break
......
......@@ -149,7 +149,7 @@ class GlancesBottle(object):
try:
plist = json.dumps(self.plugins_list)
except Exception as e:
abort(404, "Can not get plugin list (%s)" % str(e))
abort(404, "Cannot get plugin list (%s)" % str(e))
return plist
def _api_all(self):
......@@ -169,7 +169,7 @@ class GlancesBottle(object):
# Get the JSON value of the stat ID
statval = json.dumps(self.stats.getAllAsDict())
except Exception as e:
abort(404, "Can not get stats (%s)" % str(e))
abort(404, "Cannot get stats (%s)" % str(e))
return statval
def _api(self, plugin):
......@@ -192,7 +192,7 @@ class GlancesBottle(object):
# Get the JSON value of the stat ID
statval = self.stats.get_plugin(plugin).get_stats()
except Exception as e:
abort(404, "Can not get plugin %s (%s)" % (plugin, str(e)))
abort(404, "Cannot get plugin %s (%s)" % (plugin, str(e)))
return statval
def _api_limits(self, plugin):
......@@ -215,7 +215,7 @@ class GlancesBottle(object):
# Get the JSON value of the stat ID
limits = self.stats.get_plugin(plugin).get_limits()
except Exception as e:
abort(404, "Can not get limits for plugin %s (%s)" % (plugin, str(e)))
abort(404, "Cannot get limits for plugin %s (%s)" % (plugin, str(e)))
return limits
def _api_item(self, plugin, item):
......@@ -238,7 +238,7 @@ class GlancesBottle(object):
plist = self.stats.get_plugin(plugin).get_stats_item(item)
if plist is None:
abort(404, "Can not get item %s in plugin %s" % (item, plugin))
abort(404, "Cannot get item %s in plugin %s" % (item, plugin))
else:
return plist
......@@ -261,7 +261,7 @@ class GlancesBottle(object):
pdict = self.stats.get_plugin(plugin).get_stats_value(item, value)
if pdict is None:
abort(404, "Can not get item(%s)=value(%s) in plugin %s" % (item, value, plugin))
abort(404, "Cannot get item(%s)=value(%s) in plugin %s" % (item, value, plugin))
else:
return pdict
......
......@@ -635,7 +635,7 @@ class _GlancesCurses(object):
subpop.refresh()
# Create the textbox inside the subwindows
self.set_cursor(2)
textbox = glances_textbox(subpop, insert_mode=False)
textbox = GlancesTextbox(subpop, insert_mode=False)
textbox.edit()
self.set_cursor(0)
if textbox.gather() != '':
......@@ -1047,7 +1047,7 @@ class GlancesCursesBrowser(_GlancesCurses):
server_stat[c[0]] = v[c[0]]
except KeyError as e:
logger.debug(
"Can not grab stats {0} from server (KeyError: {1})".format(c[0], e))
"Cannot grab stats {0} from server (KeyError: {1})".format(c[0], e))
server_stat[c[0]] = '?'
# Display alias instead of name
try:
......@@ -1090,10 +1090,8 @@ class GlancesCursesBrowser(_GlancesCurses):
if not is_windows:
class glances_textbox(Textbox):
class GlancesTextbox(Textbox):
"""
"""
def __init__(*args, **kwargs):
Textbox.__init__(*args, **kwargs)
......
......@@ -31,8 +31,7 @@ try:
import matplotlib.pyplot as plt
except ImportError:
matplotlib_check = False
logger.warning(
'Can not load Matplotlib library. Please install it using "pip install matplotlib"')
logger.warning('Cannot load Matplotlib library. Please install it using "pip install matplotlib"')
else:
matplotlib_check = True
logger.info('Load Matplotlib version %s' % matplotlib_version)
......
......@@ -125,6 +125,6 @@ class Plugin(GlancesPlugin):
Compare a with b using the tolerance (if numerical)
"""
if str(int(a)).isdigit() and str(int(b)).isdigit():
return abs(a-b) <= max(abs(a), abs(b)) * tolerance
return abs(a - b) <= max(abs(a), abs(b)) * tolerance
else:
return a == b
......@@ -87,7 +87,7 @@ class GlancesGrabBat(object):
self.update()
except Exception as e:
self.initok = False
logger.debug("Can not init GlancesGrabBat class (%s)" % e)
logger.debug("Cannot init GlancesGrabBat class (%s)" % e)
def update(self):
"""Update the stats."""
......
......@@ -185,13 +185,13 @@ class Plugin(GlancesPlugin):
# New line
ret.append(self.curse_new_line())
if i['device_name'] == '' or i['device_name'] == 'none':
mnt_point = i['mnt_point'][-fsname_max_width+1:]
mnt_point = i['mnt_point'][-fsname_max_width + 1:]
elif len(i['mnt_point']) + len(i['device_name'].split('/')[-1]) <= fsname_max_width - 3:
# If possible concatenate mode info... Glances touch inside :)
mnt_point = i['mnt_point'] + ' (' + i['device_name'].split('/')[-1] + ')'
elif len(i['mnt_point']) > fsname_max_width:
# Cut mount point name if it is too long
mnt_point = '_' + i['mnt_point'][-fsname_max_width+1:]
mnt_point = '_' + i['mnt_point'][-fsname_max_width + 1:]
else:
mnt_point = i['mnt_point']
msg = '{0:{width}}'.format(mnt_point, width=fsname_max_width)
......
......@@ -81,7 +81,7 @@ class Plugin(GlancesPlugin):
ret.append(self.curse_new_line())
msg = msg_col.format("c", _("Sort processes by CPU%"))
ret.append(self.curse_add_line(msg))
msg = msg_col2.format("l", _("Show/hide logs (alerts)"))
msg = msg_col2.format("l", _("Show/hide alert logs"))
ret.append(self.curse_add_line(msg))
ret.append(self.curse_new_line())
msg = msg_col.format("m", _("Sort processes by MEM%"))
......@@ -96,46 +96,46 @@ class Plugin(GlancesPlugin):
ret.append(self.curse_new_line())
msg = msg_col.format("i", _("Sort processes by I/O rate"))
ret.append(self.curse_add_line(msg))
msg = msg_col2.format("1", _("Global CPU or per-CPU stats"))
ret.append(self.curse_add_line(msg))
ret.append(self.curse_new_line())
msg = msg_col.format("t", _("Sort processes by CPU times"))
ret.append(self.curse_add_line(msg))
msg = msg_col2.format("1", _("Global CPU or per-CPU stats"))
msg = msg_col2.format("h", _("Show/hide this help screen"))
ret.append(self.curse_add_line(msg))
ret.append(self.curse_new_line())
msg = msg_col.format("d", _("Show/hide disk I/O stats"))
ret.append(self.curse_add_line(msg))
msg = msg_col2.format("h", _("Show/hide this help screen"))
msg = msg_col2.format("T", _("View network I/O as combination"))
ret.append(self.curse_add_line(msg))
ret.append(self.curse_new_line())
msg = msg_col.format("f", _("Show/hide file system stats"))
msg = msg_col.format("f", _("Show/hide filesystem stats"))
ret.append(self.curse_add_line(msg))
msg = msg_col2.format("T", _("View network I/O as combination"))
msg = msg_col2.format("u", _("View cumulative network I/O"))
ret.append(self.curse_add_line(msg))
ret.append(self.curse_new_line())
msg = msg_col.format("n", _("Show/hide network stats"))
ret.append(self.curse_add_line(msg))
msg = msg_col2.format("u", _("View cumulative network I/O"))
msg = msg_col2.format("F", _("Show filesystem free space"))
ret.append(self.curse_add_line(msg))
ret.append(self.curse_new_line())
msg = msg_col.format("s", _("Show/hide sensors stats"))
ret.append(self.curse_add_line(msg))
msg = msg_col2.format("F", _("Switch between FS used and free space"))
msg = msg_col2.format("g", _("Generate graphs for current history"))
ret.append(self.curse_add_line(msg))
ret.append(self.curse_new_line())
msg = msg_col.format("2", _("Show/hide left sidebar"))
ret.append(self.curse_add_line(msg))
msg = msg_col2.format("g", _("Generate graphs for current history"))
msg = msg_col2.format("r", _("Reset history"))
ret.append(self.curse_add_line(msg))
ret.append(self.curse_new_line())
msg = msg_col.format("z", _("Enable/disable processes stats"))
ret.append(self.curse_add_line(msg))
msg = msg_col2.format("r", _("Reset history"))
msg = msg_col2.format("q", _("Quit (Esc and Ctrl-C also work)"))
ret.append(self.curse_add_line(msg))
ret.append(self.curse_new_line())
msg = msg_col.format("e", _("Enable/disable top extended stats"))
ret.append(self.curse_add_line(msg))
msg = msg_col2.format("q", _("Quit (Esc and Ctrl-C also work)"))
ret.append(self.curse_add_line(msg))
ret.append(self.curse_new_line())
msg = msg_col.format("/", _("Enable/disable short processes name"))
ret.append(self.curse_add_line(msg))
......@@ -145,6 +145,5 @@ class Plugin(GlancesPlugin):
msg = '{0}: {1}'.format("ENTER", _("Edit the process filter pattern"))
ret.append(self.curse_add_line(msg))
# Return the message with decoration
return ret
......@@ -88,7 +88,7 @@ class Plugin(GlancesPlugin):
ret = []
# Only process if stats exist and display plugin enable...
if self.stats == [] or args.disable_process:
if self.stats == [] or args.disable_process:
return ret
# Build the string message
......
......@@ -234,7 +234,7 @@ class Plugin(GlancesPlugin):
ifname = i['interface_name'].split(':')[0]
if len(ifname) > ifname_max_width:
# Cut interface name if it is too long
ifname = '_' + ifname[-ifname_max_width+1:]
ifname = '_' + ifname[-ifname_max_width + 1:]
if args.byte:
# Bytes per second (for dummy)
if args.network_cumul:
......
......@@ -81,16 +81,16 @@ class GlancesPlugin(object):
"""Init the stats history (dict of list)"""
ret = None
if self.args is not None and self.args.enable_history and self.get_items_history_list() is not None:
iList = [i['name'] for i in self.get_items_history_list()]
logger.debug("Stats history activated for plugin {0} (items: {0})".format(self.plugin_name, iList))
init_list = [i['name'] for i in self.get_items_history_list()]
logger.debug("Stats history activated for plugin {0} (items: {0})".format(self.plugin_name, init_list))
ret = {}
return ret
def reset_stats_history(self):
"""Reset the stats history (dict of list)"""
if self.args is not None and self.args.enable_history and self.get_items_history_list() is not None:
iList = [i['name'] for i in self.get_items_history_list()]
logger.debug("Reset history for plugin {0} (items: {0})".format(self.plugin_name, iList))
reset_list = [i['name'] for i in self.get_items_history_list()]
logger.debug("Reset history for plugin {0} (items: {0})".format(self.plugin_name, reset_list))
self.stats_history = {}
return self.stats_history
......
......@@ -75,7 +75,7 @@ class Plugin(GlancesPlugin):
node_data = self.get_process_curses_data(node.stats, False, args)
node_count += 1
ret.extend(node_data)
for child in node.iterChildren():
for child in node.iter_children():
# stop if we have enough nodes to display
if (max_node_count is not None) and (node_count >= max_node_count):
break
......@@ -439,7 +439,7 @@ class Plugin(GlancesPlugin):
else:
# Others sorts
if tree:
self.stats.setSorting(sortedby, sortedreverse)
self.stats.set_sorting(sortedby, sortedreverse)
else:
try:
listsorted = sorted(self.stats,
......
......@@ -79,13 +79,13 @@ class Plugin(GlancesPlugin):
self.stats = self.__set_type(self.glancesgrabsensors.get(),
'temperature_core')
except Exception as e:
logger.error("Can not grab sensors temperatures (%s)" % e)
logger.error("Cannot grab sensors temperatures (%s)" % e)
# Update HDDtemp stats
try:
hddtemp = self.__set_type(self.hddtemp_plugin.update(),
'temperature_hdd')
except Exception as e:
logger.error("Can not grab HDD temperature (%s)" % e)
logger.error("Cannot grab HDD temperature (%s)" % e)
else:
# Append HDD temperature
self.stats.extend(hddtemp)
......@@ -94,7 +94,7 @@ class Plugin(GlancesPlugin):
batpercent = self.__set_type(self.batpercent_plugin.update(),
'battery')
except Exception as e:
logger.error("Can not grab battery percent (%s)" % e)
logger.error("Cannot grab battery percent (%s)" % e)
else:
# Append Batteries %
self.stats.extend(batpercent)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册