Flush at better times

This commit is contained in:
redfast00 2020-01-22 20:19:34 +01:00
parent 49408b075b
commit c0931a8087
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C

View file

@ -148,7 +148,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
self.send_response(200) self.send_response(200)
self.end_headers() self.end_headers()
self.messagequeue.put_nowait(message) self.messagequeue.put_nowait(message)
self.wfile.write(b'Received message') self.wfile.write(b'Received message\n')
def message_collector(messagequeue): def message_collector(messagequeue):
keyboard = KeyboardHandler() keyboard = KeyboardHandler()
@ -158,9 +158,12 @@ def message_collector(messagequeue):
keyboard.printstring('\n' * 32) keyboard.printstring('\n' * 32)
else: else:
keyboard.printstring(message + '\n') keyboard.printstring(message + '\n')
keyboard.beep()
keyboard.reset_color() keyboard.reset_color()
keyboard.file.flush() keyboard.file.flush()
if messagequeue.empty():
keyboard.beep()
keyboard.file.flush()
shared_messagequeue = Queue() shared_messagequeue = Queue()