Clear keyboard queue while waiting schedule
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
# identification, and support for complex data extraction using JSON path expressions.
|
# identification, and support for complex data extraction using JSON path expressions.
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import msvcrt
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
@@ -395,6 +395,9 @@ def wait_for_scheduled_launch():
|
|||||||
print(f"\r Starting in {h:02d}:{m:02d}:{s:02d}... (at {target_str}) — Ctrl+C to cancel ",
|
print(f"\r Starting in {h:02d}:{m:02d}:{s:02d}... (at {target_str}) — Ctrl+C to cancel ",
|
||||||
end="", flush=True)
|
end="", flush=True)
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
# Flush keyboard buffer to prevent stray keystrokes from polluting subsequent prompts
|
||||||
|
while msvcrt.kbhit():
|
||||||
|
msvcrt.getwch()
|
||||||
print()
|
print()
|
||||||
console.print("[green]✓ Starting processing.[/green]")
|
console.print("[green]✓ Starting processing.[/green]")
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|||||||
Reference in New Issue
Block a user