raise KeyboardInterrupt("Imposteur !")
def hello(socket,version):
- socket.send('hello "%s"'%(version))
+ socket.send('["hello", "%s"]' % (version))
return lit(a)
def login(socket,user,mdp="",typ="bdd"):
if user in ["20-100","moibdd","#1"]:
- a.write('login ["#1","plop","bdd",[[],[],false]]')
+ a.write('["login", ["#1","plop","bdd",[[],[],false]]]')
elif user in ["vincent","moi"]:
- a.write('login ["vincent","plop","special",[]]')
+ a.write('["login", ["vincent","plop","special",[]]]')
elif user in ["toto"]:
- a.write('login ["toto","plop","bdd",[[],[],false]]')
+ a.write('["login", ["toto","plop","bdd",[[],[],false]]]')
else:
- a.write('login ["%s","%s","%s",[[],[],false]]'%(user,mdp,typ))
+ a.write('["login", ["%s","%s","%s",[[],[],false]]]'%(user,mdp,typ))
return lit(a)
def search(socket,term):
- a.write("search %s"%(term))
+ a.write('["search", %s]' % (term))
return lit(a)
def lit(socket):