forked from platypush/platypush
Support for multiple positional arguments on utils.run()
This commit is contained in:
parent
ca718d0748
commit
7b79e4b669
1 changed files with 2 additions and 2 deletions
|
@ -290,12 +290,12 @@ def is_functional_hook(obj) -> bool:
|
||||||
return callable(obj) and hasattr(obj, 'hook')
|
return callable(obj) and hasattr(obj, 'hook')
|
||||||
|
|
||||||
|
|
||||||
def run(action, **kwargs):
|
def run(action, *args, **kwargs):
|
||||||
from platypush.context import get_plugin
|
from platypush.context import get_plugin
|
||||||
(module_name, method_name) = get_module_and_method_from_action(action)
|
(module_name, method_name) = get_module_and_method_from_action(action)
|
||||||
plugin = get_plugin(module_name)
|
plugin = get_plugin(module_name)
|
||||||
method = getattr(plugin, method_name)
|
method = getattr(plugin, method_name)
|
||||||
return method(**kwargs)
|
return method(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
# vim:sw=4:ts=4:et:
|
# vim:sw=4:ts=4:et:
|
||||||
|
|
Loading…
Reference in a new issue