pynsive/reflection.py
def rlist_modules(mname):
    """
    Attempts to the submodules under a module recursively. This function
    works for modules located in the default path as well as extended paths
    via the sys.meta_path hooks.

    This function carries the expectation that the hidden module variable
    '__path__' has been set correctly.

    :param mname: the module name to descend into
    """
    module = import_module(mname)
    if not module:
        raise ImportError('Unable to load module {}'.format(mname))

    found = list()
    if _should_use_module_path(module):
        mpath = module.__path__[0]
    else:
        mpaths = sys.path
        mpath = _scan_paths_for(mname, mpaths)

    if mpath:
        for pmname in _search_for_modules(mpath, recursive=True):
            found_mod = MODULE_PATH_SEP.join((mname, pmname))
            found.append(found_mod)
    return found
def rlist_modules(mname):
    """
    Attempts to the submodules under a module recursively. This function
    works for modules located in the default path as well as extended paths
    via the sys.meta_path hooks.

    This function carries the expectation that the hidden module variable
    '__path__' has been set correctly.

    :param mname: the module name to descend into
    """
    module = import_module(mname)
    if not module:
        raise ImportError('Unable to load module {}'.format(mname))

    found = list()
    if _should_use_module_path(module):
        mpath = module.__path__[0]
    else:
        mpaths = sys.path
        mpath = _scan_paths_for(mname, mpaths)

    if mpath:
        for pmname in _search_for_modules(mpath, recursive=True):
            found_mod = MODULE_PATH_SEP.join((mname, pmname))
            found.append(found_mod)
    return found
Attempts to the submodules under a module recursively. This function
    works for modules located in the default path as well as extended paths
    via the sys.meta_path hooks.

    This function carries the expectation that the hidden module variable
    '__path__' has been set correctly.

    :param mname: the module name to descend into