def __init__(self, port, debug):
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.connect(('localhost', port))
idx = self.Buffer.find("\n")
text = self.socket.recv(2048)
idx = self.Buffer.find("\n")
line = self.Buffer[:idx + 1]
self.Buffer = self.Buffer[idx + 1:]
print("command >" + line)
""" Base class for file like objects to facilitate StdOut for the Shell."""
def write(self, s, style=None):
self.socket.send(s.encode('utf8'))
def write_warning(self, s):
def write_error(self, s):