jw-pkg/src/python/jw/pkg/cmds/__init__.py

13 lines
383 B
Python
Raw Normal View History

import importlib, pkgutil
__all__ = []
for finder, module_name, ispkg in pkgutil.iter_modules(__path__):
if not module_name.startswith("Cmd"):
continue
if module_name == "Cmd":
continue
module = importlib.import_module(f".{module_name}", __name__)
cls = getattr(module, module_name)
globals()[module_name] = cls
__all__.append(module_name)