Skip to content

Commit

Permalink
bug bizarre
Browse files Browse the repository at this point in the history
  • Loading branch information
liusiqi43 committed May 9, 2013
1 parent 8fd106b commit c8f4b37
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions python3/zerobot/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,19 @@ def _frontend_process_msg(self, msg):
#print("frontend")
self.publisher.send_multipart(msg)

try:
id_from, id_to, msg = msg
except Exception:
print(msg)
return msg
else:
pass
finally:
pass
nb = len(msg)
if nb ==2:
id_from = msg[0]
id_to = id_from.decode().split('-')[-1].encode()
msg = msg[1]
elif nb==3:
id_from = msg[0]
id_to = msg[1]
msg = msg[2]
elif nb==4:
id_from = msg[0]
id_to = msg[2]
msg = msg[3]
#print('Frontend received %s' % ((id_from, id_to, msg),))
return [id_to,id_from,msg]

Expand Down

0 comments on commit c8f4b37

Please sign in to comment.