aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-07 00:16:52 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-07 00:16:52 +0100
commit20c1782f7865b5f96b1650a65097a0e2bdd1241e (patch)
tree188a29f7e1bfa05a0a08a8d6f015f00a03d8e71e /src/plugins
parentchase demo (diff)
downloadxpybar-20c1782f7865b5f96b1650a65097a0e2bdd1241e.tar.gz
xpybar-20c1782f7865b5f96b1650a65097a0e2bdd1241e.tar.bz2
xpybar-20c1782f7865b5f96b1650a65097a0e2bdd1241e.tar.xz
fix and demo cpuonline
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/cpuonline.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/cpuonline.py b/src/plugins/cpuonline.py
index 75e8bed..8b42f66 100644
--- a/src/plugins/cpuonline.py
+++ b/src/plugins/cpuonline.py
@@ -45,8 +45,10 @@ class CPUOnline:
for filename in ('offline', 'online', 'possible', 'present'):
with open('/sys/devices/system/cpu/online', 'rb') as file:
data.append(file.read())
+
data = [x.decode('utf-8', 'replace').replace('\n', ' ').replace(',', ' ') for x in data]
- data = [reduce(lambda x, y : x + y, map(expand, x.split(' '))) for x in data]
+ data = [map(expand, filter(lambda item : not item == '', x.split(' '))) for x in data]
+ data = [reduce(lambda x, y : x + y, list(x)) for x in data]
(self.offline, self.online, self.possible, self.present) = data