commit: f3983e2204c7dd474958e4b8cf2a349288f51657
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 03:35:02 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun May 22 03:35:02 2016 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=f3983e22
countdown: only run when interactive
There's no point in sleeping when running from scripted sessions.
catalyst/support.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/catalyst/support.py b/catalyst/support.py
index f2ae5bb..60cdaf6 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'