From ab4e0019cf05c994be2ec10eaf4825dd5c3f6d15 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 29 Oct 2018 11:32:00 +0100 Subject: [PATCH] Remove immediate param in github and hipchat update function Not needed after 3638aa24203138476a2a5c8a02bffe9bdc7f27f5 --- bumblebee/modules/github.py | 7 ++----- bumblebee/modules/hipchat.py | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/bumblebee/modules/github.py b/bumblebee/modules/github.py index f5be42c..2373703 100644 --- a/bumblebee/modules/github.py +++ b/bumblebee/modules/github.py @@ -10,7 +10,6 @@ Parameters: * github.interval: Interval in minutes """ -import functools import bumblebee.input import bumblebee.output import bumblebee.engine @@ -31,14 +30,12 @@ class Module(bumblebee.engine.Module): self._requests.headers.update({"Authorization":"token {}".format(self.parameter("token", ""))}) engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE, cmd="x-www-browser https://github.com/notifications") - immediate_update = functools.partial(self.update, immediate=True) - engine.input.register_callback(self, button=bumblebee.input.RIGHT_MOUSE, - cmd=immediate_update) + engine.input.register_callback(self, button=bumblebee.input.RIGHT_MOUSE, cmd=self.update) def github(self, _): return str(self._count) - def update(self, _, immediate=False): + def update(self, _): try: self._count = 0 url = "https://api.github.com/notifications" diff --git a/bumblebee/modules/hipchat.py b/bumblebee/modules/hipchat.py index b85edc2..00898e3 100644 --- a/bumblebee/modules/hipchat.py +++ b/bumblebee/modules/hipchat.py @@ -8,7 +8,6 @@ Parameters: * hipchat.interval: Refresh interval in minutes (defaults to 5) """ -import functools import bumblebee.input import bumblebee.output import bumblebee.engine @@ -31,13 +30,12 @@ class Module(bumblebee.engine.Module): self._requests = requests.Session() self._requests.headers.update({"Authorization":"Bearer {}".format(self.parameter("token", ""))}) - immediate_update = functools.partial(self.update, immediate=True) - engine.input.register_callback(self, button=bumblebee.input.RIGHT_MOUSE, cmd=immediate_update) + engine.input.register_callback(self, button=bumblebee.input.RIGHT_MOUSE, cmd=self.update) def output(self, _): return str(self._count) - def update(self, _, immediate=False): + def update(self, _): try: self._count = 0 items = self._requests.get(HIPCHAT_API_URL).json().get('items')