diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-05-21 23:35:02 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-05-21 23:35:02 -0400 |
commit | f3983e2204c7dd474958e4b8cf2a349288f51657 (patch) | |
tree | 30429ad7997d2729487f95e6b1255e480cde4ac7 | |
parent | replace os.system with cmd (diff) | |
download | catalyst-f3983e2204c7dd474958e4b8cf2a349288f51657.tar.gz catalyst-f3983e2204c7dd474958e4b8cf2a349288f51657.tar.bz2 catalyst-f3983e2204c7dd474958e4b8cf2a349288f51657.zip |
countdown: only run when interactive
There's no point in sleeping when running from scripted sessions.
-rw-r--r-- | catalyst/support.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/catalyst/support.py b/catalyst/support.py index f2ae5bb6..60cdaf62 100644 --- a/catalyst/support.py +++ b/catalyst/support.py @@ -219,6 +219,10 @@ def addl_arg_parse(myspec,addlargs,requiredspec,validspec): def countdown(secs=5, doing="Starting"): + # If this is non-interactive (e.g. a cronjob), then sleeping is pointless. + if not os.isatty(sys.stdin.fileno()): + return + if secs: sys.stdout.write( ('>>> Waiting %s seconds before starting...\n' |