diff options
author | mathieui <mathieui@mathieui.net> | 2015-02-23 19:46:32 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2015-02-24 22:46:07 +0100 |
commit | e034b31d6bc34f43578456e9c6527bc56dff78e3 (patch) | |
tree | 77fd032b4c5727f72e4d626611fdeb0ee648f9e6 | |
parent | 18a4978456a33e6ea38de1e07b1aa43bcc10d45f (diff) | |
download | slixmpp-e034b31d6bc34f43578456e9c6527bc56dff78e3.tar.gz slixmpp-e034b31d6bc34f43578456e9c6527bc56dff78e3.tar.bz2 slixmpp-e034b31d6bc34f43578456e9c6527bc56dff78e3.tar.xz slixmpp-e034b31d6bc34f43578456e9c6527bc56dff78e3.zip |
XEP-0050: wrap send_command() and get_commands() with coroutine_wrapper
(if flow=True in send_command, the result will still be using the
default callbacks and the function will return None)
-rw-r--r-- | slixmpp/plugins/xep_0050/adhoc.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/slixmpp/plugins/xep_0050/adhoc.py b/slixmpp/plugins/xep_0050/adhoc.py index 1b32870e..6be6997c 100644 --- a/slixmpp/plugins/xep_0050/adhoc.py +++ b/slixmpp/plugins/xep_0050/adhoc.py @@ -10,7 +10,7 @@ import logging import time from slixmpp import Iq -from slixmpp.exceptions import IqError +from slixmpp.exceptions import XMPPError from slixmpp.xmlstream.handler import Callback from slixmpp.xmlstream.matcher import StanzaPath from slixmpp.xmlstream import register_stanza_plugin, JID @@ -18,6 +18,7 @@ from slixmpp.plugins import BasePlugin from slixmpp.plugins.xep_0050 import stanza from slixmpp.plugins.xep_0050 import Command from slixmpp.plugins.xep_0004 import Form +from slixmpp import coroutine_wrapper log = logging.getLogger(__name__) @@ -427,6 +428,7 @@ class XEP_0050(BasePlugin): # ================================================================= # Client side (command user) API + @coroutine_wrapper def get_commands(self, jid, **kwargs): """ Return a list of commands provided by a given JID. @@ -452,6 +454,7 @@ class XEP_0050(BasePlugin): node=Command.namespace, **kwargs) + @coroutine_wrapper def send_command(self, jid, node, ifrom=None, action='execute', payload=None, sessionid=None, flow=False, **kwargs): """ |