Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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
Exemplo n.º 4
0
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