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')