Merge "Glance skip prompting if stdin isn't a tty"
This commit is contained in:
commit
c13dbdcf5a
1
Authors
1
Authors
@ -28,6 +28,7 @@ Josh Kearney <josh@jk0.org>
|
|||||||
Justin Santa Barbara <justin@fathomdb.com>
|
Justin Santa Barbara <justin@fathomdb.com>
|
||||||
Justin Shepherd <jshepher@rackspace.com>
|
Justin Shepherd <jshepher@rackspace.com>
|
||||||
Ken Pepple <ken.pepple@gmail.com>
|
Ken Pepple <ken.pepple@gmail.com>
|
||||||
|
Ken Thomas <krt@yahoo-inc.com>
|
||||||
Kevin L. Mitchell <kevin.mitchell@rackspace.com>
|
Kevin L. Mitchell <kevin.mitchell@rackspace.com>
|
||||||
Lorin Hochstein <lorin@isi.edu>
|
Lorin Hochstein <lorin@isi.edu>
|
||||||
Major Hayden <major@mhtx.net>
|
Major Hayden <major@mhtx.net>
|
||||||
|
@ -1000,6 +1000,10 @@ def user_confirm(prompt, default=False):
|
|||||||
else:
|
else:
|
||||||
prompt_default = "[y/N]"
|
prompt_default = "[y/N]"
|
||||||
|
|
||||||
|
# for bug 884116, don't issue the prompt if stdin isn't a tty
|
||||||
|
if not hasattr(sys.stdin, 'isatty') or not sys.stdin.isatty():
|
||||||
|
return default
|
||||||
|
|
||||||
answer = raw_input("%s %s " % (prompt, prompt_default))
|
answer = raw_input("%s %s " % (prompt, prompt_default))
|
||||||
|
|
||||||
if answer == "":
|
if answer == "":
|
||||||
|
Loading…
Reference in New Issue
Block a user