summaryrefslogtreecommitdiff
path: root/examples/adhoc_user.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-08-13 00:00:34 -0700
committerLance Stout <lancestout@gmail.com>2011-08-13 00:10:06 -0700
commitc26b716164d123b177fd069b9e04cb07eab79b56 (patch)
tree64bb5393ecb99f061a65812bac1f423ed733b1fd /examples/adhoc_user.py
parentdcaddb804221790e778742f3f5ef22464608cc87 (diff)
downloadslixmpp-c26b716164d123b177fd069b9e04cb07eab79b56.tar.gz
slixmpp-c26b716164d123b177fd069b9e04cb07eab79b56.tar.bz2
slixmpp-c26b716164d123b177fd069b9e04cb07eab79b56.tar.xz
slixmpp-c26b716164d123b177fd069b9e04cb07eab79b56.zip
Update XEP-0050 to use new IQ exceptions.
IqError is now caught and forwarded to the command error handler referenced in the session. Errors are now caught and processed by the session's error handler whether or not the results Iq stanza includes the <command> substanza. Added the option for blocking command calls. The blocking option is set during start_command with block=True. Subsequent command flow methods use session['block'] to determine their blocking behaviour. If you use blocking commands, then you will need to wrap your command calls in a try/except block for IqTimeout exceptions.
Diffstat (limited to 'examples/adhoc_user.py')
-rwxr-xr-xexamples/adhoc_user.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/adhoc_user.py b/examples/adhoc_user.py
index 738b22cd..5fba78d2 100755
--- a/examples/adhoc_user.py
+++ b/examples/adhoc_user.py
@@ -136,6 +136,7 @@ class CommandUserBot(sleekxmpp.ClientXMPP):
# The session will automatically be cleared if no error
# handler is provided.
self['xep_0050'].terminate_command(session)
+ self.disconnect()
if __name__ == '__main__':
@@ -176,7 +177,7 @@ if __name__ == '__main__':
if opts.other is None:
opts.other = raw_input("JID Providing Commands: ")
if opts.greeting is None:
- opts.other = raw_input("Greeting: ")
+ opts.greeting = raw_input("Greeting: ")
# Setup the CommandBot and register plugins. Note that while plugins may
# have interdependencies, the order in which you register them does