def _get_module(module_name):
"""Returns a tuple with all objects that could be instantiated
without arguments.
Args:
module_name: A string object. It represents the name of the top-level module.
Returns:
A ModuleType object with all sub-modules imported from the given module.
"""
top_level_module = importlib.import_module(module_name)
prefix = modulename(top_level_module) + "."
try:
for module_loader, name, is_pkg in pkgutil.walk_packages(path=top_level_module.__path__, prefix=prefix):
importlib.import_module(name, top_level_module)
except (ImportError, ImportWarning) as e:
LOG.debug(str(e))
return top_level_module
评论列表
文章目录