'Initialise an instance.
:param path: The root of the directory tree to search.
:param kwargs: Passed to the superclass constructor,
except for:
* recursive - if True (the default), subdirectories are
recursed into. If False, only the top-level directory
is searched,'

def __init__(self, path, **kwargs):

    self.recursive = kwargs.pop('recursive', True)
    super(DirectoryLocator, self).__init__(**kwargs)
    path = os.path.abspath(path)
    if (not os.path.isdir(path)):
        raise DistlibException(('Not    a    directory:    %r' % path))
    self.base_dir = path
