MCPcopy Create free account
hub / github.com/FonaTech/Clouds-Coder / __init__

Method __init__

split_coder.py:725–737  ·  view source on GitHub ↗
(self, layout: Dict[str, List[str]])

Source from the content-addressed store, hash-verified

723 """Routes each NodeInfo to an output module path using layout rules."""
724
725 def __init__(self, layout: Dict[str, List[str]]) -> None:
726 self.layout = layout
727 self._fallback_classifier = AutoLayoutGenerator()
728 # Pre-compile: list of (module_path, list_of_matchers)
729 self._rules: List[Tuple[str, List[Tuple[str, object]]]] = []
730 for mod_path, patterns in layout.items():
731 matchers: List[Tuple[str, object]] = []
732 for pat in patterns:
733 if pat.startswith("~"):
734 matchers.append(("regex", re.compile(pat[1:])))
735 else:
736 matchers.append(("exact", pat))
737 self._rules.append((mod_path, matchers))
738
739 def route(self, node: NodeInfo) -> str:
740 """Return the target module path for a node."""

Callers

nothing calls this directly

Calls 1

AutoLayoutGeneratorClass · 0.70

Tested by

no test coverage detected