summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2014-08-16 22:37:29 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-09-01 02:47:15 +0200
commit67ca2dd0f45b112e206fb80eb4613960f312f721 (patch)
tree3a9dc1727e2e51ba39d0ece0a17d2998f52cc981 /examples
parent882f984b2622a6e44cce5401b8673760f559f718 (diff)
downloadslixmpp-67ca2dd0f45b112e206fb80eb4613960f312f721.tar.gz
slixmpp-67ca2dd0f45b112e206fb80eb4613960f312f721.tar.bz2
slixmpp-67ca2dd0f45b112e206fb80eb4613960f312f721.tar.xz
slixmpp-67ca2dd0f45b112e206fb80eb4613960f312f721.zip
Import getpass from getpass, instead of using getpass.getpass everytime.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/IoT_TestDevice.py2
-rwxr-xr-xexamples/adhoc_provider.py4
-rwxr-xr-xexamples/adhoc_user.py4
-rwxr-xr-xexamples/admin_commands.py4
-rwxr-xr-xexamples/custom_stanzas/custom_stanza_provider.py4
-rwxr-xr-xexamples/custom_stanzas/custom_stanza_user.py4
-rwxr-xr-xexamples/disco_browser.py4
-rwxr-xr-xexamples/download_avatars.py4
-rwxr-xr-xexamples/echo_client.py4
-rwxr-xr-xexamples/echo_component.py4
-rwxr-xr-xexamples/gtalk_custom_domain.py4
-rwxr-xr-xexamples/ibb_transfer/ibb_receiver.py4
-rwxr-xr-xexamples/ibb_transfer/ibb_sender.py4
-rwxr-xr-xexamples/migrate_roster.py6
-rwxr-xr-xexamples/muc.py4
-rwxr-xr-xexamples/ping.py4
-rwxr-xr-xexamples/proxy_echo_client.py6
-rwxr-xr-xexamples/pubsub_client.py4
-rwxr-xr-xexamples/pubsub_events.py4
-rwxr-xr-xexamples/register_account.py4
-rwxr-xr-xexamples/roster_browser.py4
-rwxr-xr-xexamples/send_client.py4
-rwxr-xr-xexamples/set_avatar.py4
-rwxr-xr-xexamples/thirdparty_auth.py4
-rwxr-xr-xexamples/user_location.py4
-rwxr-xr-xexamples/user_tune.py4
26 files changed, 53 insertions, 53 deletions
diff --git a/examples/IoT_TestDevice.py b/examples/IoT_TestDevice.py
index 795d782a..17041956 100755
--- a/examples/IoT_TestDevice.py
+++ b/examples/IoT_TestDevice.py
@@ -152,7 +152,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
xmpp = IoT_TestDevice(opts.jid,opts.password)
diff --git a/examples/adhoc_provider.py b/examples/adhoc_provider.py
index 7d1a41ee..fa8135ac 100755
--- a/examples/adhoc_provider.py
+++ b/examples/adhoc_provider.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -160,7 +160,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
# Setup the CommandBot and register plugins. Note that while plugins may
# have interdependencies, the order in which you register them does
diff --git a/examples/adhoc_user.py b/examples/adhoc_user.py
index 31ff0d11..a1f35a59 100755
--- a/examples/adhoc_user.py
+++ b/examples/adhoc_user.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -163,7 +163,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
if opts.other is None:
opts.other = input("JID Providing Commands: ")
if opts.greeting is None:
diff --git a/examples/admin_commands.py b/examples/admin_commands.py
index ef0dc5bf..928c2fc6 100755
--- a/examples/admin_commands.py
+++ b/examples/admin_commands.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -135,7 +135,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
if opts.command is None:
opts.command = input("Admin command: ")
diff --git a/examples/custom_stanzas/custom_stanza_provider.py b/examples/custom_stanzas/custom_stanza_provider.py
index fc04bdd4..e9060c87 100755
--- a/examples/custom_stanzas/custom_stanza_provider.py
+++ b/examples/custom_stanzas/custom_stanza_provider.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -124,7 +124,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
# Setup the CommandBot and register plugins. Note that while plugins may
# have interdependencies, the order in which you register them does
diff --git a/examples/custom_stanzas/custom_stanza_user.py b/examples/custom_stanzas/custom_stanza_user.py
index 95837106..6e5c3e0c 100755
--- a/examples/custom_stanzas/custom_stanza_user.py
+++ b/examples/custom_stanzas/custom_stanza_user.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -130,7 +130,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
if opts.other is None:
opts.other = input("JID Providing custom stanza: ")
diff --git a/examples/disco_browser.py b/examples/disco_browser.py
index 2a4ce543..7c126388 100755
--- a/examples/disco_browser.py
+++ b/examples/disco_browser.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -166,7 +166,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
# Setup the Disco browser.
xmpp = Disco(opts.jid, opts.password, args[1], args[2], args[0])
diff --git a/examples/download_avatars.py b/examples/download_avatars.py
index d2e3ab2a..b002ff08 100755
--- a/examples/download_avatars.py
+++ b/examples/download_avatars.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
import threading
from optparse import OptionParser
@@ -144,7 +144,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
xmpp = AvatarDownloader(opts.jid, opts.password)
xmpp.register_plugin('xep_0054')
diff --git a/examples/echo_client.py b/examples/echo_client.py
index 1046bd43..6d2317c9 100755
--- a/examples/echo_client.py
+++ b/examples/echo_client.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -100,7 +100,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
# Setup the EchoBot and register plugins. Note that while plugins may
# have interdependencies, the order in which you register them does
diff --git a/examples/echo_component.py b/examples/echo_component.py
index 0512f37c..b51e3b2c 100755
--- a/examples/echo_component.py
+++ b/examples/echo_component.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -84,7 +84,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Component JID: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
if opts.server is None:
opts.server = input("Server: ")
if opts.port is None:
diff --git a/examples/gtalk_custom_domain.py b/examples/gtalk_custom_domain.py
index 2c1d5beb..3897c6d2 100755
--- a/examples/gtalk_custom_domain.py
+++ b/examples/gtalk_custom_domain.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -120,7 +120,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
# Setup the GTalkBot and register plugins. Note that while plugins may
# have interdependencies, the order in which you register them does
diff --git a/examples/ibb_transfer/ibb_receiver.py b/examples/ibb_transfer/ibb_receiver.py
index 9045bd69..add53675 100755
--- a/examples/ibb_transfer/ibb_receiver.py
+++ b/examples/ibb_transfer/ibb_receiver.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -110,7 +110,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
xmpp = IBBReceiver(opts.jid, opts.password)
diff --git a/examples/ibb_transfer/ibb_sender.py b/examples/ibb_transfer/ibb_sender.py
index 261202aa..35a7f429 100755
--- a/examples/ibb_transfer/ibb_sender.py
+++ b/examples/ibb_transfer/ibb_sender.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -96,7 +96,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
if opts.receiver is None:
opts.receiver = input("Receiver: ")
if opts.filename is None:
diff --git a/examples/migrate_roster.py b/examples/migrate_roster.py
index e7849135..599d9644 100755
--- a/examples/migrate_roster.py
+++ b/examples/migrate_roster.py
@@ -3,7 +3,7 @@
import sys
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -44,12 +44,12 @@ logging.basicConfig(level=opts.loglevel,
if opts.old_jid is None:
opts.old_jid = input("Old JID: ")
if opts.old_password is None:
- opts.old_password = getpass.getpass("Old Password: ")
+ opts.old_password = getpass("Old Password: ")
if opts.new_jid is None:
opts.new_jid = input("New JID: ")
if opts.new_password is None:
- opts.new_password = getpass.getpass("New Password: ")
+ opts.new_password = getpass("New Password: ")
old_xmpp = slixmpp.ClientXMPP(opts.old_jid, opts.old_password)
diff --git a/examples/muc.py b/examples/muc.py
index b609cefe..4a1b36ca 100755
--- a/examples/muc.py
+++ b/examples/muc.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -153,7 +153,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
if opts.room is None:
opts.room = input("MUC room: ")
if opts.nick is None:
diff --git a/examples/ping.py b/examples/ping.py
index dd3ce737..bc35d975 100755
--- a/examples/ping.py
+++ b/examples/ping.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -99,7 +99,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
# Setup the PingTest and register plugins. Note that while plugins may
# have interdependencies, the order in which you register them does
diff --git a/examples/proxy_echo_client.py b/examples/proxy_echo_client.py
index 56ecb78f..34ed98a4 100755
--- a/examples/proxy_echo_client.py
+++ b/examples/proxy_echo_client.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -109,7 +109,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
if opts.proxy_host is None:
opts.proxy_host = input("Proxy host: ")
if opts.proxy_port is None:
@@ -117,7 +117,7 @@ if __name__ == '__main__':
if opts.proxy_user is None:
opts.proxy_user = input("Proxy username: ")
if opts.proxy_pass is None and opts.proxy_user:
- opts.proxy_pass = getpass.getpass("Proxy password: ")
+ opts.proxy_pass = getpass("Proxy password: ")
# Setup the EchoBot and register plugins. Note that while plugins may
# have interdependencies, the order in which you register them does
diff --git a/examples/pubsub_client.py b/examples/pubsub_client.py
index 36d044fd..d780ac71 100755
--- a/examples/pubsub_client.py
+++ b/examples/pubsub_client.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -151,7 +151,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
if len(args) == 2:
args = (args[0], args[1], '', '', '')
diff --git a/examples/pubsub_events.py b/examples/pubsub_events.py
index eb678cfd..20af1fbe 100755
--- a/examples/pubsub_events.py
+++ b/examples/pubsub_events.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -112,7 +112,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
logging.info("Run this in conjunction with the pubsub_client.py " + \
"example to watch events happen as you give commands.")
diff --git a/examples/register_account.py b/examples/register_account.py
index 29885f90..d26ce61e 100755
--- a/examples/register_account.py
+++ b/examples/register_account.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -131,7 +131,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
# Setup the RegisterBot and register plugins. Note that while plugins may
# have interdependencies, the order in which you register them does
diff --git a/examples/roster_browser.py b/examples/roster_browser.py
index 8f3e0d80..859ced3b 100755
--- a/examples/roster_browser.py
+++ b/examples/roster_browser.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
import threading
from optparse import OptionParser
@@ -132,7 +132,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
xmpp = RosterBrowser(opts.jid, opts.password)
diff --git a/examples/send_client.py b/examples/send_client.py
index 9a03f708..40bfea56 100755
--- a/examples/send_client.py
+++ b/examples/send_client.py
@@ -10,7 +10,7 @@
"""
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
import slixmpp
@@ -97,7 +97,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
if opts.to is None:
opts.to = input("Send To: ")
if opts.message is None:
diff --git a/examples/set_avatar.py b/examples/set_avatar.py
index e446497b..4292c970 100755
--- a/examples/set_avatar.py
+++ b/examples/set_avatar.py
@@ -12,7 +12,7 @@
import os
import imghdr
import logging
-import getpass
+from getpass import getpass
import threading
from optparse import OptionParser
@@ -132,7 +132,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
if opts.filepath is None:
opts.filepath = input("Avatar file location: ")
diff --git a/examples/thirdparty_auth.py b/examples/thirdparty_auth.py
index 504048a9..8f402087 100755
--- a/examples/thirdparty_auth.py
+++ b/examples/thirdparty_auth.py
@@ -11,7 +11,7 @@
import sys
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
try:
@@ -122,7 +122,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
access_token = None
diff --git a/examples/user_location.py b/examples/user_location.py
index 74cad8af..8ad9f5c1 100755
--- a/examples/user_location.py
+++ b/examples/user_location.py
@@ -2,7 +2,7 @@
import sys
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
try:
@@ -99,7 +99,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
xmpp = LocationBot(opts.jid, opts.password)
diff --git a/examples/user_tune.py b/examples/user_tune.py
index 2f28de35..a1411e9c 100755
--- a/examples/user_tune.py
+++ b/examples/user_tune.py
@@ -2,7 +2,7 @@
import sys
import logging
-import getpass
+from getpass import getpass
from optparse import OptionParser
try:
@@ -111,7 +111,7 @@ if __name__ == '__main__':
if opts.jid is None:
opts.jid = input("Username: ")
if opts.password is None:
- opts.password = getpass.getpass("Password: ")
+ opts.password = getpass("Password: ")
xmpp = TuneBot(opts.jid, opts.password)