summaryrefslogtreecommitdiff
path: root/examples/muc.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-12-31 17:27:57 -0800
committerLance Stout <lancestout@gmail.com>2011-12-31 17:27:57 -0800
commit1b0fd76b45bb1c6e6409aa6e3e0b0c2edf5ba374 (patch)
treeee77dff6d6bbd8a068a06912146b6dbfdab931e2 /examples/muc.py
parent4a12e1059a8cc38a3baf30a18dd6143e7d5beebb (diff)
parent46e93bea09c05ab1183fd94981dcaa2654e5d0fd (diff)
downloadslixmpp-1b0fd76b45bb1c6e6409aa6e3e0b0c2edf5ba374.tar.gz
slixmpp-1b0fd76b45bb1c6e6409aa6e3e0b0c2edf5ba374.tar.bz2
slixmpp-1b0fd76b45bb1c6e6409aa6e3e0b0c2edf5ba374.tar.xz
slixmpp-1b0fd76b45bb1c6e6409aa6e3e0b0c2edf5ba374.zip
Merge pull request #131 from rhcarvalho/master
Small changes to the examples
Diffstat (limited to 'examples/muc.py')
-rwxr-xr-xexamples/muc.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/muc.py b/examples/muc.py
index 7af37449..7586c61c 100755
--- a/examples/muc.py
+++ b/examples/muc.py
@@ -11,7 +11,7 @@
import sys
import logging
-import time
+import getpass
from optparse import OptionParser
import sleekxmpp
@@ -161,9 +161,14 @@ if __name__ == '__main__':
logging.basicConfig(level=opts.loglevel,
format='%(levelname)-8s %(message)s')
- if None in [opts.jid, opts.password, opts.room, opts.nick]:
- optp.print_help()
- sys.exit(1)
+ if opts.jid is None:
+ opts.jid = raw_input("Username: ")
+ if opts.password is None:
+ opts.password = getpass.getpass("Password: ")
+ if opts.room is None:
+ opts.room = raw_input("MUC room: ")
+ if opts.nick is None:
+ opts.nick = raw_input("MUC nickname: ")
# Setup the MUCBot and register plugins. Note that while plugins may
# have interdependencies, the order in which you register them does