Revert "[modules/battery] Fix syntax error"

This reverts commit f236c24b92.
This commit is contained in:
Tobias Witek 2018-01-11 20:26:14 +01:00
parent f236c24b92
commit 166437649c
3 changed files with 3 additions and 13 deletions

View file

@ -40,7 +40,6 @@ class Module(object):
self.id = self.name self.id = self.name
self._next = int(time.time()) self._next = int(time.time())
self._default_interval = 0 self._default_interval = 0
self.success = True
self._configFile = None self._configFile = None
for cfg in [os.path.expanduser("~/.bumblebee-status.conf"), os.path.expanduser("~/.config/bumblebee-status.conf")]: 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): def update_wrapper(self, widgets):
if self._next > int(time.time()): if self._next > int(time.time()):
return return
try:
self.update(self._widgets) 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._next += int(self.parameter("interval", self._default_interval))*60 self._next += int(self.parameter("interval", self._default_interval))*60
def interval(self, intvl): def interval(self, intvl):

View file

@ -105,7 +105,6 @@ class Module(bumblebee.engine.Module):
state.append("AC") state.append("AC")
else: else:
charge = "" charge = ""
try:
with open("{}/status".format(widget.name)) as f: with open("{}/status".format(widget.name)) as f:
charge = f.read().strip() charge = f.read().strip()
except IOError: except IOError:

View file

@ -17,9 +17,6 @@ class Module(bumblebee.engine.Module):
) )
self._text = self.parameter("text", "") self._text = self.parameter("text", "")
def update(self, widgets):
raise Exception("test")
def text(self, widget): def text(self, widget):
return self._text return self._text