From 650e0b933e438f9e620f4c85c43224cb5e093518 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Thu, 11 Jan 2018 20:31:48 +0100 Subject: [PATCH] Revert "[modules/getcrypto] Deal with kraken service downtime" This reverts commit 3615e60e5b91903f374f20e77a82e1918cd40468. Time to go to sleep, so many mistakes... --- bumblebee/engine.py | 8 +------- bumblebee/modules/getcrypto.py | 2 -- bumblebee/output.py | 2 +- 3 files changed, 2 insertions(+), 10 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/getcrypto.py b/bumblebee/modules/getcrypto.py index d75b373..502e100 100644 --- a/bumblebee/modules/getcrypto.py +++ b/bumblebee/modules/getcrypto.py @@ -34,8 +34,6 @@ def getfromkrak(coin, currency): krakenget = requests.get('https://api.kraken.com/0/public/Ticker?pair='+epair).json() except (RequestException, Exception): return "No connection" - if not 'result' in krakenget: - return "No data" kethusdask = float(krakenget['result'][tickname]['a'][0]) kethusdbid = float(krakenget['result'][tickname]['b'][0]) return coin+": "+str((kethusdask+kethusdbid)/2)[0:6] diff --git a/bumblebee/output.py b/bumblebee/output.py index af6fcc4..99dadc3 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -117,7 +117,7 @@ class I3BarOutput(object): }) width = self._theme.minwidth(widget) self._widgets.append({ - u"full_text": full_text + u"full_text": full_text, "color": self._theme.fg(widget), "background": self._theme.bg(widget), "separator_block_width": self._theme.separator_block_width(widget),