def outReceived(self, data): try: print("Process out " + data, file=stderr) except UnicodeDecodeError: print("Process out (unicodeerror)", file=stderr) for line in b(data).strip().split(b('\n')): line = self.filterout(line.strip()) if self.currentclient and line: self.currentclient.sendLine(line)
def outReceived(self, data): try: print("Process out " + data,file=stderr) except UnicodeDecodeError: print("Process out (unicodeerror)",file=stderr) for line in b(data).strip().split(b('\n')): line = self.filterout(line.strip()) if self.currentclient and line: self.currentclient.sendLine(line)
def errReceived(self, data): try: print("Process err " + data, file=stderr) except UnicodeDecodeError: print("Process out (unicodeerror)", file=stderr) if self.printstderr and data: print(data.strip(), file=stderr) for line in b(data).strip().split(b("\n")): line = self.filtererr(line.strip()) if self.sendstderr and self.currentclient and line: self.currentclient.sendLine(line)
def outReceived(self, data): try: if sys.version >= '3' and isinstance(data, bytes): print("Process out " + str(data, 'utf-8'), file=stderr) else: print("Process out " + data, file=stderr) except UnicodeDecodeError: print("Process out (unicodeerror)", file=stderr) print("DEBUG:", repr(b(data).strip().split(b('\n')))) for line in b(data).strip().split(b('\n')): line = self.filterout(line.strip()) if self.currentclient and line: self.currentclient.sendLine(b(line))
def outReceived(self, data): try: if sys.version >= '3' and isinstance(data,bytes): print("Process out " + str(data, 'utf-8'),file=stderr) else: print("Process out " + data,file=stderr) except UnicodeDecodeError: print("Process out (unicodeerror)",file=stderr) print("DEBUG:", repr(b(data).strip().split(b('\n')))) for line in b(data).strip().split(b('\n')): line = self.filterout(line.strip()) if self.currentclient and line: self.currentclient.sendLine(b(line))
def errReceived(self, data): try: if sys.version >= '3' and isinstance(data, bytes): print("Process err " + str(data, 'utf-8'), file=sys.stderr) else: print("Process err " + data, file=stderr) except UnicodeDecodeError: print("Process out (unicodeerror)", file=stderr) if self.printstderr and data: print(data.strip(), file=stderr) for line in b(data).strip().split(b('\n')): line = self.filtererr(line.strip()) if self.sendstderr and self.currentclient and line: self.currentclient.sendLine(b(line))
def errReceived(self, data): try: if sys.version >= '3' and isinstance(data,bytes): print("Process err " + str(data,'utf-8'), file=sys.stderr) else: print("Process err " + data,file=stderr) except UnicodeDecodeError: print("Process out (unicodeerror)",file=stderr) if self.printstderr and data: print(data.strip(),file=stderr) for line in b(data).strip().split(b('\n')): line = self.filtererr(line.strip()) if self.sendstderr and self.currentclient and line: self.currentclient.sendLine(b(line))
def lineReceived(self, line): try: print("Client in: " + line, file=stderr) except UnicodeDecodeError: print("Client in: (unicodeerror)", file=stderr) if sys.version < "3": if isinstance(line, unicode): self.factory.processprotocol.transport.write(line.encode("utf-8")) else: self.factory.processprotocol.transport.write(line) self.factory.processprotocol.transport.write(b("\n")) else: self.factory.processprotocol.transport.write(b(line + "\n")) self.factory.processprotocol.currentclient = self
def lineReceived(self, line): try: print("Client in: " + line, file=stderr) except UnicodeDecodeError: print("Client in: (unicodeerror)", file=stderr) if sys.version < '3': if isinstance(line, unicode): self.factory.processprotocol.transport.write( line.encode('utf-8')) else: self.factory.processprotocol.transport.write(line) self.factory.processprotocol.transport.write(b('\n')) else: self.factory.processprotocol.transport.write(b(line + '\n')) self.factory.processprotocol.currentclient = self
def connectionMade(self): print("Client connected", file=stderr) self.factory.connections += 1 if self.factory.connections < 1: self.transport.loseConnection() else: self.sendLine(b("READY"))
def lineReceived(self, line): try: print("Client in: " + line,file=stderr) except UnicodeDecodeError: print("Client in: (unicodeerror)",file=stderr) self.factory.processprotocol.transport.write(b(line +'\n')) self.factory.processprotocol.currentclient = self
def connectionMade(self): print("Client connected", file=stderr) self.factory.connections += 1 if self.factory.connections != 1: self.transport.loseConnection() else: self.sendLine(b("READY"))
def lineReceived(self, line): try: print("Client in: " + line, file=stderr) except UnicodeDecodeError: print("Client in: (unicodeerror)", file=stderr) self.factory.processprotocol.transport.write(b(line + '\n')) self.factory.processprotocol.currentclient = self
def lineReceived(self, line): try: if sys.version >= '3' and isinstance(line,bytes): print("Client in: " + str(line,'utf-8'),file=stderr) else: print("Client in: " + line,file=stderr) except UnicodeDecodeError: print("Client in: (unicodeerror)",file=stderr) if sys.version < '3': if isinstance(line,unicode): self.factory.processprotocol.transport.write(line.encode('utf-8')) else: self.factory.processprotocol.transport.write(line) self.factory.processprotocol.transport.write(b('\n')) else: self.factory.processprotocol.transport.write(b(line) + b('\n')) self.factory.processprotocol.currentclient = self