mininet-sample/topos/__init__.py

12 lines
368 B
Python
Raw Normal View History

2020-06-24 10:28:44 +00:00
import importlib
import pkgutil
import os
from core.topo import Topo, TopoConfig
pkg_dir = os.path.dirname(__file__)
for (module_loader, name, ispkg) in pkgutil.iter_modules([pkg_dir]):
importlib.import_module('.' + name, __package__)
2020-06-24 14:11:54 +00:00
TOPO_CONFIGS = {cls.NAME: cls for cls in TopoConfig.__subclasses__()}
TOPOS = {cls.NAME: cls for cls in Topo.__subclasses__()}