From: Vincent Le Gallic Date: Tue, 24 Apr 2012 02:00:47 +0000 (+0200) Subject: plouf X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=909f2a12e401bd80084088dd8cb9bea40d81c73e;p=NK2015_Client_Python_Alpha.git plouf --- diff --git a/client.py b/client.py index 8cbbb33..9bff069 100755 --- 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']