X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=nullclient.py;h=c9e1953223f1473f4f5c724638d576078fe93e06;hp=93fd270ce7fb33f15e8c0b58017136c1ea497e82;hb=7875a5e5e9f90b84fb2893adb2ac779f61e85668;hpb=a29730a9b6c00cfeaacc64311349df4da9ce1c8b diff --git a/nullclient.py b/nullclient.py index 93fd270..c9e1953 100644 --- a/nullclient.py +++ b/nullclient.py @@ -1,5 +1,7 @@ import purple import ecore +import getpass +import sys class NullClient: def __init__(self): @@ -22,12 +24,22 @@ class NullClient: self.account.set_password(password) self.account.set_enabled("carman-purple-python", True) +def getuser(): + sys.stdout.write("GTalk account: ") + username = sys.stdin.readline() + return username[:-1] + +def getpassword(): + return getpass.getpass() + if __name__ == '__main__': client = NullClient() client.execute() client.set_protocol("XMPP") - client.new_account("seu_email@email.com", client.protocol,"sua_senha_aqui") + username = getuser() + password = getpassword() + client.new_account(username, client.protocol, password) client.p.connect() ecore.main_loop_begin()