From 36966e962eb06d4f72d6d9f71e149e9f885dfe59 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 16 Jul 2012 14:25:19 -0500 Subject: [PATCH] issue 889, thanks spiffytech --- VERSION | 2 +- gluon/shell.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 57970275..4ab61e83 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-07-16 14:11:51) dev +Version 2.00.0 (2012-07-16 14:25:16) dev diff --git a/gluon/shell.py b/gluon/shell.py index e5e2bc20..b9c10d57 100644 --- a/gluon/shell.py +++ b/gluon/shell.py @@ -172,8 +172,13 @@ def run( die(errmsg) adir = os.path.join('applications', a) if not os.path.exists(adir): - if raw_input('application %s does not exist, create (y/n)?' - % a).lower() in ['y', 'yes']: + if sys.stdin and not sys.stdin.name == '/dev/null': + c = raw_input('application %s does not exist, create (y/n)?' % a) + else: + logging.warn('application does not exist and will not be created') + return + if c.lower() in ['y', 'yes']: + os.mkdir(adir) w2p_unpack('welcome.w2p', adir) for subfolder in ['models','views','controllers', 'databases',