Skip to content

Commit

Permalink
Merge pull request #12 from j4cobgarby/prompt-on-interactive
Browse files Browse the repository at this point in the history
made resman -c only require user interaction in interactive sessions
  • Loading branch information
j4cobgarby authored May 3, 2024
2 parents 8d05021 + e1d640d commit a73a426
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion resman.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a73a426

Please sign in to comment.