Files
ISSSTELEON/Core/core/domains.py
T
Roberto Treviño b9ed108855 ISSSTELEON 8a7974a
2026-11-29 18:09:05 -06:00

25 lines
586 B
Python

import importlib
from enum import StrEnum
from types import ModuleType
class Domain(StrEnum):
CACU = "cacu"
CAMA = "cama"
TEA = "tea"
def part(domain: Domain, name: str = "") -> ModuleType | None:
path = f"core.{domain.value}" + (f".{name}" if name else "")
try:
return importlib.import_module(path)
except ModuleNotFoundError as e:
if e.name is not None and path.startswith(e.name):
return None
raise
def measures(domain: Domain) -> dict:
found = part(domain, "measures")
return found.MEASURES if found else {}