Ejemplo n.º 1
0
 def sendLine(self, line):
     "hook overloading the one used by linereceiver"
     #print "sendLine (%s):\n%s" % (self.state, line)
     #escape IAC in line mode, and correctly add \r\n
     line += self.delimiter
     line = line.replace(IAC, IAC + IAC).replace('\n', '\r\n')
     return self.transport.write(mccp_compress(self, line))
Ejemplo n.º 2
0
 def _write(self, data):
     "hook overloading the one used in plain telnet"
     #print "_write (%s): %s" % (self.state,  " ".join(str(ord(c)) for c in data))
     data = data.replace('\n', '\r\n').replace('\r\r\n', '\r\n')
     #data = data.replace('\n', '\r\n')
     super(TelnetProtocol, self)._write(mccp_compress(self, data))