Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ef parse(line):
- line = line.lstrip(":")
- temp = line.split(" :", 1)
- data = []
- data.extend(temp[0].split(" "))
- try:
- data.append(temp[1])
- except IndexError:
- pass
- return data
- def readline(sock):
- global buffer
- try:
- buffer[sock]
- except:
- buffer[sock] = ""
- while "\n" not in buffer[sock]:
- new = sock.recv(2**12)
- buffer[sock] += new
- if len(new) == 0:
- break
- splt = buffer[sock].split("\n", 1)
- try:
- buffer[sock] = splt[1]
- except:
- buffer[sock] = ""
- return splt[0].rstrip("\r\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement