aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-03-29 01:06:31 +0100
committerMattias Andrée <maandree@operamail.com>2015-03-29 01:06:31 +0100
commitf3f76e9b47492b60f9fc6e7735be332d36b97eaa (patch)
tree85bbc01a3c11b65790e839fa578c618336075191 /src/plugins
parentadd get_event_mask and get_override_redirect (diff)
downloadxpybar-f3f76e9b47492b60f9fc6e7735be332d36b97eaa.tar.gz
xpybar-f3f76e9b47492b60f9fc6e7735be332d36b97eaa.tar.bz2
xpybar-f3f76e9b47492b60f9fc6e7735be332d36b97eaa.tar.xz
small fixes
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/cpuonline.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/cpuonline.py b/src/plugins/cpuonline.py
index 2dd7d42..5c063d6 100644
--- a/src/plugins/cpuonline.py
+++ b/src/plugins/cpuonline.py
@@ -43,12 +43,13 @@ class CPUOnline:
data = []
for filename in ('offline', 'online', 'possible', 'present'):
- with open('/sys/devices/system/cpu/online', 'rb') as file:
+ with open('/sys/devices/system/cpu/' + filename, 'rb') as file:
data.append(file.read())
data = [x.decode('utf-8', 'replace').replace('\n', ' ').replace(',', ' ') 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]
+ data = [x if x is not None else [] for x in data]
(self.offline, self.online, self.possible, self.present) = data