From c042be12ed115c0a00b2e8fad58e06f2624f88f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Mand=C3=A1k?= Date: Mon, 22 Jun 2015 11:07:23 +0200 Subject: [PATCH] Module: `on_click` now returns True if a valid click event callback was found and executed, False otherwise. --- i3pystatus/core/modules.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/i3pystatus/core/modules.py b/i3pystatus/core/modules.py index d26c266..700af3e 100644 --- a/i3pystatus/core/modules.py +++ b/i3pystatus/core/modules.py @@ -91,21 +91,23 @@ class Module(SettingsBase): cb = self.on_downscroll else: self.logger.info("Button '%d' not handled yet." % (button)) - return + return False if not cb: self.logger.info("no cb attached") - return + return False else: cb, args = split_callback_and_args(cb) self.logger.debug("cb=%s args=%s" % (cb, args)) if callable(cb): - return cb(self) + cb(self) elif hasattr(self, cb): - return getattr(self, cb)(*args) + if cb is not "run": + getattr(self, cb)(*args) else: - return run_through_shell(cb, *args) + run_through_shell(cb, *args) + return True def move(self, position): self.position = position