示例#1
0
def confirm(destname):
    """Ask whether destination name should be overwrited."""
    while True:
        try:
            return yesno(input("File '{}' already exist. Overwrite? [yn] ".format(destname)))
        except ValueError:
            continue
示例#2
0
def yesno_type(string):
    """Interpret argument as a "yes" or a "no".

    Raise `argparse.ArgumentTypeError` if string cannot be analysed.
    """
    try:
        return yesno(string)
    except ValueError as error:
        raise argparse.ArgumentTypeError(str(error))
示例#3
0
def yesno_type(string):
    """Interpret argument as a "yes" or a "no".

    Raise `argparse.ArgumentTypeError` if string cannot be analysed.
    """
    try:
        return yesno(string)
    except ValueError as error:
        raise argparse.ArgumentTypeError(str(error))
示例#4
0
def confirm(destname):
    """Ask whether destination name should be overwrited."""
    while True:
        try:
            return yesno(
                input("File '{}' already exist. Overwrite? [yn] ".format(
                    destname)))
        except ValueError:
            continue