def valid_response(prompt, *valid):
    ans = console_input(prompt).lower()

    if ans in valid:
        return True
    elif ans == '':
        return None

    return False
def valid_response(prompt, *valid):
    """ Will display a prompt for a command-line user. If the input is in the
        valid given valid list then it will return True. Otherwise, it will
        return False. If no input is received from the user, None is returned
        instead.

    :param string prompt: string prompt to give to the user
    :param string \\*valid: valid responses
    """
    ans = console_input(prompt).lower()

    if ans in valid:
        return True
    elif ans == '':
        return None

    return False
Exemple #3
0
def valid_response(prompt, *valid):
    """Prompt user for input.

    Will display a prompt for a command-line user. If the input is in the
    valid given valid list then it will return True. Otherwise, it will
    return False. If no input is received from the user, None is returned
    instead.

    :param string prompt: string prompt to give to the user
    :param string \\*valid: valid responses
    """
    ans = utils.console_input(prompt).lower()

    if ans in valid:
        return True
    elif ans == '':
        return None

    return False
 def input(self, prompt):
     """ Provide a command prompt """
     return console_input(prompt)
 def input(self, prompt):
     """Provide a command prompt."""
     return utils.console_input(prompt)
Exemple #6
0
 def input(self, prompt):
     """Provide a command prompt."""
     return utils.console_input(prompt)
 def input(self, prompt):
     return console_input(prompt)