提交 ee2bce20 编写于 作者: N nicolargo

Resolv compatibility issue with 2.7 or lower in client/server mode (round 1)

上级 07b737ab
......@@ -51,20 +51,8 @@ class GlancesStatsServer(GlancesStats):
def _set_stats(self, input_stats):
"""Set the stats to the input_stats one."""
# Build the all_stats with the get_raw() method of the plugins
ret = collections.defaultdict(dict)
for p in self._plugins:
ret[p] = self._plugins[p].get_raw()
return ret
return {p: self._plugins[p].get_raw() for p in self._plugins if self._plugins[p].is_enable()}
def getAll(self):
"""Return the stats as a list."""
return self.all_stats
def getAllAsDict(self):
"""Return the stats as a dict."""
# Python > 2.6
# return {p: self.all_stats[p] for p in self._plugins}
ret = {}
for p in self._plugins:
ret[p] = self.all_stats[p]
return ret
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册