harvester/utils/__init__.py
def prepare_plugin_options(plugin_class, options):
    """
    Prepare plugin options by extracting / converting supported
    values from a plugin.
    """

    opt_schema = plugin_class.get_options()

    if options is None:
        options = {}

    conf = {}
    for opt_def in opt_schema.itervalues():
        if opt_def.name in options:
            # Take type, value from the passed-in value
            type_, value = options.pop(opt_def.name)

            # If type is not specified on the command line,
            # use the default type for this option.
            if type_ is None:
                type_ = opt_def.type

            # Perform type conversion
            value = convert_string(type_, value)
            conf[opt_def.name] = value

        else:
            # Option was not specified -- use default
            conf[opt_def.name] = opt_def.default

    # Now trigger warnings for any option left around..

    for name in options:
        warnings.warn(
            "Unknown configuration option {0!r} passed to plugin {1!r}"
            .format(name, plugin_class),
            UserWarning)

    return conf

    Prepare plugin options by extracting / converting supported
    values from a plugin.
    
Prepare plugin options by extracting / converting supported
values from a plugin.
Prepare plugin options by extracting / converting supported values from a plugin .
def prepare_plugin_options(plugin_class, options):
    opt_schema = plugin_class.get_options()
    if options is None:
        options = {}
    conf = {}
    for opt_def in opt_schema.itervalues():
        if opt_def.name in options:
            type_, value = options.pop(opt_def.name)
            if type_ is None:
                type_ = opt_def.type
            value = convert_string(type_, value)
            conf[opt_def.name] = value
        else:
            conf[opt_def.name] = opt_def.default
    for name in options:
        warnings.warn(
            "Unknown configuration option {0!r} passed to plugin {1!r}"
            .format(name, plugin_class),
            UserWarning)
    return conf
def prepare_plugin_options ( plugin_class , options ) : opt_schema = plugin_class . get_options ( ) if options is None : options = { } conf = { } for opt_def in opt_schema . itervalues ( ) : if opt_def . name in options : type_ , value = options . pop ( opt_def . name ) if type_ is None : type_ = opt_def . type value = convert_string ( type_ , value ) conf [ opt_def . name ] = value else : conf [ opt_def . name ] = opt_def . default for name in options : warnings . warn ( "Unknown configuration option {0!r} passed to plugin {1!r}" . format ( name , plugin_class ) , UserWarning ) return conf
Prepare plugin options by extracting / converting supported
values from a plugin.
Prepare plugin options by extracting / converting supported values from a plugin .
"""
    Prepare plugin options by extracting / converting supported
    values from a plugin.
    """ # Take type, value from the passed-in value # If type is not specified on the command line, # use the default type for this option. # Perform type conversion # Option was not specified -- use default # Now trigger warnings for any option left around..
plugin_class
options