projects
/
python-purple
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support to console's input to nullclient.py
[python-purple]
/
nullclient.py
diff --git
a/nullclient.py
b/nullclient.py
index
93fd270
..
c9e1953
100644
(file)
--- a/
nullclient.py
+++ b/
nullclient.py
@@
-1,5
+1,7
@@
import purple
import ecore
import purple
import ecore
+import getpass
+import sys
class NullClient:
def __init__(self):
class NullClient:
def __init__(self):
@@
-22,12
+24,22
@@
class NullClient:
self.account.set_password(password)
self.account.set_enabled("carman-purple-python", True)
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")
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()
client.p.connect()
ecore.main_loop_begin()