'Prompt for a parameter, and set the value in the session on response'

def prompt_param(self, name, value, plugin):

    valid_convert = {1: 'YES', 0: 'NO'}
    param = plugin.getParameter(name)
    attribs = util.iDict(param.getAttributeList())
    attribvals = param.getAttributeValueList()
    args = {'name': name, 'value': value, 'description': attribs['Description'], 'required': attribs['Required'], 'valid': valid_convert[plugin.isValid(name)], 'type': attribs.get('Type', 'Choice'), 'attribs': attribvals}
    if plugin.isParamchoice(name):
        default_value = ''
        for (i, p) in enumerate(attribvals):
            if (p.name.lower() == value.lower()):
                default_value = str(i)
    else:
        default_value = value
    self.io.print_prompt_param(args, default_value)
    line = self.io.prompt_user(name, default_value, attribvals, gvars=self.fb.fbglobalvars)
    if (line != value):
        self.do_set(((name + '    ') + line))
    if plugin.hasValidValue(name):
        return True
    else:
        return False
