Updated on() to allow return values
modified line 21 added line 22-23 Signed-off-by: Casey Diemel <diemelcw@gmail.com>
This commit is contained in:
parent
17d20837a3
commit
3773f96901
@ -18,7 +18,9 @@ def on(event_name, *args, **kwargs):
|
|||||||
if cb_name in plugin.__dict__:
|
if cb_name in plugin.__dict__:
|
||||||
# print("calling %s %s(%s)" %(cb_name, args, kwargs))
|
# print("calling %s %s(%s)" %(cb_name, args, kwargs))
|
||||||
try:
|
try:
|
||||||
plugin.__dict__[cb_name](*args, **kwargs)
|
ret_val = plugin.__dict__[cb_name](*args, **kwargs)
|
||||||
|
if ret_val is not None:
|
||||||
|
return ret_val
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error("error while running %s.%s : %s" % (plugin_name, cb_name, e))
|
logging.error("error while running %s.%s : %s" % (plugin_name, cb_name, e))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user