From e1d640d07d46db5890cc85ae9baf5bcbb55973d9 Mon Sep 17 00:00:00 2001 From: Jacob Garby Date: Fri, 3 May 2024 11:49:39 +0200 Subject: [PATCH] made resman -c only require user interaction in interactive sessions --- resman.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resman.py b/resman.py index 84a596c..3ac6b79 100755 --- a/resman.py +++ b/resman.py @@ -220,7 +220,10 @@ def main(): else: snds = int(dat["start_time"] + dat["duration"] - time.time()) print(f"Time remaining: {secs2timestring(snds)}") - input(cols.WARNING + "Please press ENTER" + cols.ENDC + " to confirm that you've read this :) ") + + # Only prompt for read confirmation if in interactive session + if sys.stdout.isatty(): + input(cols.WARNING + "Please press ENTER" + cols.ENDC + " to confirm that you've read this :) ") return else: print(cols.OKGREEN + "No one is running any experiment right now, do what you like :)" + cols.ENDC)