From 9759d6eea519dcfe85fc1e09feb6bd8399509bf5 Mon Sep 17 00:00:00 2001 From: enkore Date: Mon, 1 Feb 2016 17:09:47 +0100 Subject: [PATCH] Revert "Lift restriction that "run" cannot be used as a callback" This reverts commit d018be872a366bdaa1feddb5460fb30880af27e1. --- i3pystatus/core/modules.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/i3pystatus/core/modules.py b/i3pystatus/core/modules.py index e5982e7..f60ac3e 100644 --- a/i3pystatus/core/modules.py +++ b/i3pystatus/core/modules.py @@ -101,8 +101,12 @@ class Module(SettingsBase): elif our_method: cb(self, *args) elif hasattr(self, cb): - self.__log_button_event(button, cb, args, "Member callback") - getattr(self, cb)(*args) + if cb is not "run": + # CommandEndpoint already calls run() after every + # callback to instantly update any changed state due + # to the callback's actions. + self.__log_button_event(button, cb, args, "Member callback") + getattr(self, cb)(*args) else: self.__log_button_event(button, cb, args, "External command") if hasattr(self, "data"):