Skip to content
Snippets Groups Projects
Commit 1614cf70 authored by Ian's avatar Ian Committed by Ian
Browse files

style: update after-interrupt prompt for clarity

parent 6dddb376
No related branches found
No related tags found
No related merge requests found
...@@ -236,16 +236,17 @@ def main( ...@@ -236,16 +236,17 @@ def main(
except KeyboardInterrupt: except KeyboardInterrupt:
return "exit" return "exit"
else: else:
print(f"\nMonitoring suspended. Press 'r' to resubmit failed jobs, " print(f"\nMonitoring suspended. Enter 'r' to resubmit, 'x' to exit, or wait {timeout} seconds to resume.")
f"press Ctrl-C to exit, or wait {timeout} seconds to resume.")
try: try:
# wait for user input with timeout # wait for user input with timeout
signal.signal(signal.SIGALRM, lambda s, f: (_ for _ in ()).throw(TimeoutError())) signal.signal(signal.SIGALRM, lambda s, f: (_ for _ in ()).throw(TimeoutError()))
signal.alarm(timeout) signal.alarm(timeout)
answer = input().strip().lower() answer = input("> ").strip().lower()
signal.alarm(0) signal.alarm(0)
if answer == "r": if answer == "r":
return "resubmit" return "resubmit"
elif answer == "x":
return "exit"
return "resume" return "resume"
except TimeoutError: except TimeoutError:
return "resume" return "resume"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment