cleanup debug code

This commit is contained in:
chrys 2018-03-26 21:49:00 +02:00
parent 45ad72568f
commit 3d8dba29a1

View File

@ -113,7 +113,6 @@ class driver(screenDriver):
def handleSigwinch(self, *args): def handleSigwinch(self, *args):
os.write(self.signalPipe[1], b'w') os.write(self.signalPipe[1], b'w')
def terminalEmulation(self,active , eventQueue): def terminalEmulation(self,active , eventQueue):
debug = False
try: try:
old_attr = termios.tcgetattr(sys.stdin) old_attr = termios.tcgetattr(sys.stdin)
tty.setraw(0) tty.setraw(0)
@ -135,8 +134,6 @@ class driver(screenDriver):
terminal.resize(lines, columns) terminal.resize(lines, columns)
# input # input
if sys.stdin in r: if sys.stdin in r:
if debug:
print('pre stdin')
try: try:
msgBytes = self.readAll(sys.stdin.fileno()) msgBytes = self.readAll(sys.stdin.fileno())
eventQueue.put({"Type":fenrirEventType.ByteInput, eventQueue.put({"Type":fenrirEventType.ByteInput,
@ -146,28 +143,18 @@ class driver(screenDriver):
active.value = False active.value = False
break break
#self.injectTextToScreen(msgBytes) #self.injectTextToScreen(msgBytes)
if debug:
print('after stdin')
# output # output
if self.p_out in r: if self.p_out in r:
if debug:
print('pre p_out')
try: try:
msgBytes = self.readAll(self.p_out.fileno(), timeout=0.2) msgBytes = self.readAll(self.p_out.fileno(), timeout=0.2)
except (EOFError, OSError): except (EOFError, OSError):
active.value = False active.value = False
break break
if debug:
print('after p_out read',msgBytes)
terminal.feed(msgBytes) terminal.feed(msgBytes)
os.write(sys.stdout.fileno(), msgBytes) os.write(sys.stdout.fileno(), msgBytes)
if debug:
print('after p_out write')
eventQueue.put({"Type":fenrirEventType.ScreenUpdate, eventQueue.put({"Type":fenrirEventType.ScreenUpdate,
"Data":screen_utils.createScreenEventData(terminal.dump()) "Data":screen_utils.createScreenEventData(terminal.dump())
}) })
if debug:
print('after p_out')
except Exception as e: # Process died? except Exception as e: # Process died?
print(e) print(e)
active.value = False active.value = False