def do_send(self, data): lines = string.split(data, "\n") if lines[-1] == "": lines = lines[:-1] for l in lines: terminal.show_line("out", l+"\n") self.sock.sendall(data)
def do_send(self, data): lines = string.split(data, "\n") if lines[-1] == "": lines = lines[:-1] for l in lines: terminal.show_line("out", l + "\n") self.sock.sendall(data)
def grab_lines(self): data = self.partial + self.sock.recv(4096) got_lines = string.split(data, "\n") for l in got_lines[:-1]: terminal.show_line("in", l) self.lines.append(l) self.partial = got_lines[-1] return (got_lines[:-1], got_lines[-1])