prioriy to input

This commit is contained in:
chrys 2018-03-26 13:22:29 +02:00
parent bb6fc4d3ab
commit 4847b1c78b

View File

@ -130,7 +130,22 @@ class driver(screenDriver):
if self.signalPipe[0] in r: if self.signalPipe[0] in r:
os.read(self.signalPipe[0], 1) os.read(self.signalPipe[0], 1)
lines, columns = self.resizeTerminal(self.p_out) lines, columns = self.resizeTerminal(self.p_out)
terminal.resize(lines, columns) terminal.resize(lines, columns)
# input
if sys.stdin in r:
if debug:
print('pre stdin')
try:
msgBytes = self.readAll(sys.stdin.fileno())
eventQueue.put({"Type":fenrirEventType.ByteInput,
"Data":msgBytes
})
except (EOFError, OSError):
active.value = False
break
#self.injectTextToScreen(msgBytes)
if debug:
print('after stdin')
# output # output
if self.p_out in r: if self.p_out in r:
if debug: if debug:
@ -150,22 +165,7 @@ class driver(screenDriver):
"Data":screen_utils.createScreenEventData(terminal.dump()) "Data":screen_utils.createScreenEventData(terminal.dump())
}) })
if debug: if debug:
print('after p_out') print('after p_out')
# input
if sys.stdin in r:
if debug:
print('pre stdin')
try:
msgBytes = self.readAll(sys.stdin.fileno())
eventQueue.put({"Type":fenrirEventType.ByteInput,
"Data":msgBytes
})
except (EOFError, OSError):
active.value = False
break
#self.injectTextToScreen(msgBytes)
if debug:
print('after stdin')
except Exception as e: # Process died? except Exception as e: # Process died?
print(e) print(e)
active.value = False active.value = False