litex-boards/litex_boards/targets.py

16 lines
433 B
Python

import sys
import importlib
class Targets:
def __getattr__(self, name):
if name == "__path__":
return []
for support in ["official", "partner", "community"]:
try:
return importlib.import_module("litex_boards." + support + ".targets." + name)
except ModuleNotFoundError:
pass
raise ModuleNotFoundError
sys.modules[__name__] = Targets()