Update for Python3

This commit is contained in:
2020-11-10 01:47:47 +00:00
parent fbfb32f8b1
commit 85aaf1385e
7 changed files with 936 additions and 722 deletions

View File

@@ -58,7 +58,7 @@ class Interface:
while (self.running):
tty_in = os.read(self.m, readLen)
for tty_out in self.handleInput(tty_in):
os.write(self.m, tty_out)
os.write(self.m, tty_out.encode())
##%% handleInput(tty_in)
@@ -67,7 +67,7 @@ class Interface:
## address. That device must handle the command via dev.handleCMD(cmd, args)
##
def handleInput(self, tty_in):
tty_in = tty_in.strip()
tty_in = tty_in.strip().decode()
if tty_in != "" and self.addr in self.devices:
dev = self.devices[self.addr]
@@ -83,5 +83,5 @@ class Interface:
##
def addDevice(self, dev, addr):
self.devices[addr] = dev