From 166437649ca7200cdf974cef9b333252a59c4fe4 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Thu, 11 Jan 2018 20:26:14 +0100 Subject: [PATCH] Revert "[modules/battery] Fix syntax error" This reverts commit f236c24b92fb61d0c47580138942aee49f6201d1. --- bumblebee/engine.py | 8 +------- bumblebee/modules/battery.py | 5 ++--- bumblebee/modules/spacer.py | 3 --- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/bumblebee/engine.py b/bumblebee/engine.py index 9f31e06..df5b0da 100644 --- a/bumblebee/engine.py +++ b/bumblebee/engine.py @@ -40,7 +40,6 @@ class Module(object): self.id = self.name self._next = int(time.time()) self._default_interval = 0 - self.success = True self._configFile = None for cfg in [os.path.expanduser("~/.bumblebee-status.conf"), os.path.expanduser("~/.config/bumblebee-status.conf")]: @@ -81,12 +80,7 @@ class Module(object): def update_wrapper(self, widgets): if self._next > int(time.time()): return - try: - self.update(self._widgets) - self.success = True - except Exception as e: - log.error("failed to update module {}: {}".format(self.name, str(e))) - self.success = False + self.update(self._widgets) self._next += int(self.parameter("interval", self._default_interval))*60 def interval(self, intvl): diff --git a/bumblebee/modules/battery.py b/bumblebee/modules/battery.py index 5367d5f..57a12cc 100644 --- a/bumblebee/modules/battery.py +++ b/bumblebee/modules/battery.py @@ -105,9 +105,8 @@ class Module(bumblebee.engine.Module): state.append("AC") else: charge = "" - try: - with open("{}/status".format(widget.name)) as f: - charge = f.read().strip() + with open("{}/status".format(widget.name)) as f: + charge = f.read().strip() except IOError: pass if charge == "Discharging": diff --git a/bumblebee/modules/spacer.py b/bumblebee/modules/spacer.py index adabcff..b89c233 100644 --- a/bumblebee/modules/spacer.py +++ b/bumblebee/modules/spacer.py @@ -17,9 +17,6 @@ class Module(bumblebee.engine.Module): ) self._text = self.parameter("text", "") - def update(self, widgets): - raise Exception("test") - def text(self, widget): return self._text