[modules/battery] Fix syntax error

see #221
This commit is contained in:
Tobias Witek 2018-01-11 20:22:21 +01:00
parent bbfb6fc095
commit f236c24b92
3 changed files with 13 additions and 3 deletions

View file

@ -40,6 +40,7 @@ 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")]:
@ -80,7 +81,12 @@ class Module(object):
def update_wrapper(self, widgets):
if self._next > int(time.time()):
return
self.update(self._widgets)
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._next += int(self.parameter("interval", self._default_interval))*60
def interval(self, intvl):