grim/pyscovery

19570d2d0da1
Parents 13f48ef9ba20
Children 3ac87a5cb01c
Fixed the last of the known bugs for Loader class
  • +4 -4
    pyscovery.py
  • --- a/pyscovery.py Sun May 26 05:37:49 2013 -0500
    +++ b/pyscovery.py Sun May 26 05:43:42 2013 -0500
    @@ -138,7 +138,7 @@
    mod = importlib.import_module(module)
    if recurse and _is_package(mod):
    - _recurse(mod)
    + self._recurse(mod, modules)
    for symbol_name in dir(mod):
    if symbol_name == cls_name:
    @@ -172,7 +172,7 @@
    return base == '__init__'
    - def _recurse(self, module):
    + def _recurse(self, module, modules):
    """
    Adds additional modules from a package
    """
    @@ -190,11 +190,11 @@
    filename = os.path.join(dirname, name)
    if os.path.isdir(filename):
    - self.add_module(make_module(base))
    + self._real_add_module(make_module(base), modules)
    elif os.path.isfile(filename):
    if fnmatch.fnmatch(name, '*.py') or \
    fnmatch.fnmatch(name, '*.py[co]'):
    - self.add_module(make_module(base))
    + self._real_add_module(make_module(base), modules)
    _DEFAULT_LOADER = Loader()