Module: Allow passing of arguments to callable callbacks.

This commit is contained in:
Lukáš Mandák 2015-09-25 13:58:08 +02:00
parent 32ab77c203
commit d07168beb7

View File

@ -102,7 +102,7 @@ class Module(SettingsBase):
self.logger.debug("cb=%s args=%s" % (cb, args)) self.logger.debug("cb=%s args=%s" % (cb, args))
if callable(cb): if callable(cb):
cb(self) cb(self, *args)
elif hasattr(self, cb): elif hasattr(self, cb):
if cb is not "run": if cb is not "run":
getattr(self, cb)(*args) getattr(self, cb)(*args)