A VCS repository archival tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
425 B

  1. import pkgutil
  2. __all__ = []
  3. def _import_modules():
  4. prefixLen = len(__name__) + 1
  5. for importer, moduleName, isPkg in pkgutil.iter_modules(__path__, prefix = f'{__name__}.'):
  6. assert not isPkg
  7. moduleNameWithoutPrefix = moduleName[prefixLen:]
  8. __all__.append(moduleNameWithoutPrefix)
  9. module = importer.find_module(moduleName).load_module(moduleName)
  10. globals()[moduleNameWithoutPrefix] = module
  11. _import_modules()