def confirm(message, default=None): "ask a yes/no question, return result" if not sys.stdout.isatty(): if default is None: raise RuntimeError("Non interactive, tried to ask: %s" % message) return default reply = msysio.raw_input_("\n%s [Y/n]:" % message) if reply and reply[0].lower() == 'n': return False return True
def confirm(message): "ask a yes/no question, return result" reply = msysio.raw_input_("\n%s [Y/n]:" % message) if reply and reply[0].lower() == 'n': return False return True