Prompts user for a value
354897
def enter_config_value(self, key, default=""):
        ''' 
        '''
        value = input('Please enter a value for ' + key + ': ')
        if value:
            return value
        else:
            return default
1058841
def continue_prompt(message=""):
    
    answer = False
    message = message + "\n'Yes' or 'No' to continue: "
    while answer not in ('Yes', 'No'):
        answer = prompt(message, eventloop=eventloop())
        if answer == "Yes":
            answer = True
            break
        if answer == "No":
            answer = False
            break
    return answer
543787
function Prompt() {
  BasePrompt.apply(this, arguments);
  if (typeof this.question.source !== 'function') {
    throw new TypeError('expected source to be defined');
  }

  this.currentChoices = [];
  this.firstRender = true;
  this.selected = 0;

  // Make sure no default is set (so it won't be printed)
  this.question.default = undefined;
  this.paginator = new Paginator();
}
803118
def prompt_for_value(self, ctx):
        
        # Calculate the default before prompting anything to be stable.
        default = self.get_default(ctx)
        if isinstance(default, AutoDefault):
            return self.type_cast_value(ctx, default.value)

        # If this is a prompt for a flag we need to handle this
        # differently.
        if self.is_bool_flag:
            return confirm(self.prompt, default)

        return prompt(self.prompt, default=default,
                      hide_input=self.hide_input,
                      confirmation_prompt=self.confirmation_prompt,
                      value_proc=lambda x: self.process_value(ctx, x))
368975
def is_user(value, min=None, max=None):
    

    if type(value) == str:
        try:
            entry = pwd.getpwnam(value)
            value = entry.pw_uid
        except KeyError:
            err_message = ('{0}: No such user.'.format(value))
            raise validate.VdtValueError(err_message)

        return value

    elif type(value) == int:
        try:
            pwd.getpwuid(value)
        except KeyError:
            err_message = ('{0}: No such user.'.format(value))
            raise validate.VdtValueError(err_message)

        return value

    else:
        err_message = ('Please, use str or int to "user" parameter.')
        raise validate.VdtTypeError(err_message)
515253
protected function maybe_prompt() {
		if ( ! $this->is_time() ) {
			return;
		}

		\add_action( 'admin_footer', array( $this, 'script' ) );
		if ( false !== $this->op['notice_callback'] ) {
			call_user_func_array( $this->op['notice_callback'], array( &$this ) );
		} else {
			\add_action( 'admin_notices', array( $this, 'add_notice' ) );
		}
	}
194459
def choice(opts, default=1, text='Please make a choice.'):
    
    opts_len = len(opts)
    opts_enum = enumerate(opts, 1)
    opts = list(opts)

    for key, opt in opts_enum:
        click.echo('[{k}] {o}'.format(k=key, o=opt[1] if isinstance(opt, tuple) else opt))

    click.echo('-' * 12)
    opt = click.prompt(text, default, type=click.IntRange(1, opts_len))
    opt = opts[opt - 1]
    return opt[0] if isinstance(opt, tuple) else opt
790542
def display_value(self, ctx, value):
        
        gandi = ctx.obj
        gandi.log('%s: %s' % (self.name, (value if value is not None
                                          else 'Not found')))
208896
def display_value(self, value):
        

        if not (isinstance(value, bool) or value == 'all'):
            raise InvalidUsage("Display value can be of type bool or value 'all'")

        self._sysparms['sysparm_display_value'] = value
733643
def set(self, value):
        """"""
        if self.validate(value):
            #print "Parameter " + self.id + " successfully set to " + repr(value)
            self.hasvalue = True
            self.value = value
            return True
        else:
            #print "Parameter " + self.id + " COULD NOT BE set to " + repr(value)
            return False
798533
def _ask(question, default=None, data_type='str', show_hint=False):
    """"""

    data = default

    if data_type == 'bool':
        data = None
        default_string = "Y" if default else "N"

        while data not in ('Y', 'J', 'N', '1', '0'):
            data = input("%s? [%s]: " % (question, default_string)).upper()

            if data == '':
                return default

        return data in ('Y', 'J', '1')

    elif data_type in ('str', 'unicode'):
        if show_hint:
            msg = "%s? [%s] (%s): " % (question, default, data_type)
        else:
            msg = question

        data = input(msg)

        if len(data) == 0:
            data = default
    elif data_type == 'int':
        if show_hint:
            msg = "%s? [%s] (%s): " % (question, default, data_type)
        else:
            msg = question

        data = input(msg)

        if len(data) == 0:
            data = int(default)
        else:
            data = int(data)

    return data
1120430
def quick_confirm(prompt, default_value):
        
        valid = False
        value = default_value.lower()
        while not valid:
            input_val = compat_input(prompt + "[{0}]: ".format(default_value))

            if input_val == "":
                value = default_value.lower()
                valid = True
            else:
                try:
                    if input_val.lower() in ['y', 'n']:
                        value = input_val.lower()
                        valid = True
                    else:
                        print("ERROR: enter 'Y' or 'N'.")
                        valid = False

                except ValueError:
                    print("ERROR: enter 'Y' or 'N'.")
                    valid = False

        return value
665568
def AskString(message, value='', title='FontParts'):
    
    return dispatcher["AskString"](message=message, value=value, title=title)
745529
def yesno(prompt):
    
    prompt += " [y/n]"
    a = ""
    while a not in ["y", "n"]:
        a = input(prompt).lower()

    return a == "y"
128400
public static function prompt()
    {
        $stdin = fopen('php://stdin', 'r');
        $answer = self::trimAnswer(fgets($stdin, 4096));
        fclose($stdin);

        return $answer;
    }
622155
def prompt(msg, default=NO_DEFAULT, validate=None):
    
    while True:
        response = input(msg + " ").strip()
        if not response:
            if default is NO_DEFAULT:
                continue
            return default
        if validate is None or validate(response):
            return response
1210002
def input(self, prompt, default=None, show_default=True):
        """"""
        return click.prompt(prompt, default=default, show_default=show_default)