Import getpass from getpass, instead of using getpass.getpass everytime.

This commit is contained in:
Emmanuel Gil Peyrot 2014-08-16 22:37:29 +02:00 committed by Florent Le Coz
parent 882f984b26
commit 67ca2dd0f4
26 changed files with 53 additions and 53 deletions

View file

@ -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)

View file

@ -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

View file

@ -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:

View file

@ -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: ")

View file

@ -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

View file

@ -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: ")

View file

@ -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])

View file

@ -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')

View file

@ -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

View file

@ -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:

View file

@ -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

View file

@ -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)

View file

@ -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:

View file

@ -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)

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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], '', '', '')

View file

@ -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.")

View file

@ -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

View file

@ -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)

View file

@ -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:

View file

@ -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: ")

View file

@ -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

View file

@ -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)

View file

@ -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)