]> gitweb.pimeys.fr Git - NK2015_Client_Python_Alpha.git/commitdiff
plouf
authorVincent Le Gallic <legallic@crans.org>
Tue, 24 Apr 2012 02:00:47 +0000 (04:00 +0200)
committerVincent Le Gallic <legallic@crans.org>
Tue, 24 Apr 2012 02:00:47 +0000 (04:00 +0200)
client.py

index 8cbbb33c46d4bb41ff10c28ba7596e22bbc75505..9bff069d737620868d6b3416528d6cfc5c408573 100755 (executable)
--- a/client.py
+++ b/client.py
@@ -52,6 +52,8 @@ def login(socket,user,mdp="",typ="bdd"):
         a.write('login ["20-100","plop","bdd"]')
     elif user in ["vincent","moi"]:
         a.write('login ["vincent","plop","special"]')
+    elif user in ["toto"]:
+        a.write('login ["toto","plop","bdd"]')
     else:
         a.write('login ["%s","%s","%s"]'%(user,mdp,typ))
     return lit(a)
@@ -62,7 +64,7 @@ def search(socket,term):
 
 def lit(socket):
     try:
-        t=a.read()
+        t=a.read(4096)
         obj=json.loads(t)
         if obj["retcode"]==0:
           return obj['msg']