Flush at better times
This commit is contained in:
parent
49408b075b
commit
c0931a8087
1 changed files with 5 additions and 2 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue