Remove immediate param in github and hipchat update function

Not needed after 3638aa2420
This commit is contained in:
Frederic Junod 2018-10-29 11:32:00 +01:00
parent 4a63bfc45b
commit ab4e0019cf
2 changed files with 4 additions and 9 deletions

View file

@ -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"

View file

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