X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=nullclient.py;h=c9e1953223f1473f4f5c724638d576078fe93e06;hp=375625fc30c55f52fde7570a93a3adfa6e352dac;hb=7875a5e5e9f90b84fb2893adb2ac779f61e85668;hpb=f73c4168c56d09ed8a2e280d391d0ca094892056;ds=sidebyside diff --git a/nullclient.py b/nullclient.py index 375625f..c9e1953 100644 --- a/nullclient.py +++ b/nullclient.py @@ -1,4 +1,7 @@ import purple +import ecore +import getpass +import sys class NullClient: def __init__(self): @@ -21,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() - client.p.run_loop() + ecore.main_loop_begin()