MCPcopy Create free account
hub / github.com/BUPT-GAMMA/MASFactory / match_declaration

Method match_declaration

masfactory/utils/selector.py:66–72  ·  view source on GitHub ↗

Match a (name, type) declaration against this selector. This is used by NodeTemplate materialization where only a declared name/type is available (no live instance).

(self, *, name: str | None, cls: type | None)

Source from the content-addressed store, hash-verified

64 return self._match_target(SelectionTarget.from_obj(obj))
65
66 def match_declaration(self, *, name: str | None, cls: type | None) -> bool:
67 """Match a (name, type) declaration against this selector.
68
69 This is used by NodeTemplate materialization where only a declared name/type is
70 available (no live instance).
71 """
72 return self._match_target(SelectionTarget(name=name, cls=cls, obj=None))
73
74 def _match_target(self, target: SelectionTarget) -> bool:
75 if self._type_filter:

Callers 1

_materializeMethod · 0.80

Calls 2

_match_targetMethod · 0.95
SelectionTargetClass · 0.85

Tested by

no test coverage detected