From a63094af474535e906f6796966dd6bc2538d22b9 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Tue, 1 Nov 2016 07:58:50 +0100 Subject: [PATCH] [output] Using "instance" for callback registration doesn't make sense "instance" is actually better suited to be an argument to the callback (which it already is) than part of the key for callback lookup. --- bumblebee/output.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/bumblebee/output.py b/bumblebee/output.py index c3b232b..743b08f 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -4,30 +4,21 @@ class Output(object): self._theme = theme self._callbacks = {} - def add_callback(self, cmd, button, module=None, instance=None): + def add_callback(self, cmd, button, module=None): self._callbacks[( button, module, - instance )] = cmd def callback(self, event): cb = self._callbacks.get(( event.get("button", -1), event.get("name", None), - event.get("instance", None) - ), None) - if cb is not None: return cb - cb = self._callbacks.get(( - event.get("button", -1), - event.get("name", None), - None ), None) if cb is not None: return cb cb = self._callbacks.get(( event.get("button", -1), None, - None ), None) return cb