'Create a URLParser object that looks at `directory`.
`base_python_name` is the package that this directory
represents, thus any Python modules in this directory will
be given names under this package.'

def __init__(self, global_conf, directory, base_python_name, index_names=NoDefault, hide_extensions=NoDefault, ignore_extensions=NoDefault, constructors=None, **constructor_conf):

    if global_conf:
        import warnings
        warnings.warn('The    global_conf    argument    to    URLParser    is    deprecated;    either    pass    in    None    or    {},    or    use    make_url_parser', DeprecationWarning)
    else:
        global_conf = {}
    if (os.path.sep != '/'):
        directory = directory.replace(os.path.sep, '/')
    self.directory = directory
    self.base_python_name = base_python_name
    if (index_names is NoDefault):
        index_names = global_conf.get('index_names', ('index', 'Index', 'main', 'Main'))
    self.index_names = converters.aslist(index_names)
    if (hide_extensions is NoDefault):
        hide_extensions = global_conf.get('hide_extensions', ('.pyc', '.bak', '.py~', '.pyo'))
    self.hide_extensions = converters.aslist(hide_extensions)
    if (ignore_extensions is NoDefault):
        ignore_extensions = global_conf.get('ignore_extensions', ())
    self.ignore_extensions = converters.aslist(ignore_extensions)
    self.constructors = self.global_constructors.copy()
    if constructors:
        self.constructors.update(constructors)
    for (name, value) in constructor_conf.items():
        if (not name.startswith('constructor    ')):
            raise ValueError(("Only    extra    configuration    keys    allowed    are    'constructor    .ext    =    import_expr';    you    gave    %r    (=%r)" % (name, value)))
        ext = name[len('constructor    '):].strip()
        if isinstance(value, (str, unicode)):
            value = import_string.eval_import(value)
        self.constructors[ext] = value
