MCPcopy
hub / github.com/KhronosGroup/Vulkan-Docs / __init__

Method __init__

scripts/spec_tools/validity.py:157–176  ·  view source on GitHub ↗

Prepare to add a validity entry, optionally with a VUID anchor. An anchor is generated by concatenating the elements of the anchor tuple with dashes at the end of the VUID anchor name.

(self, text=None, anchor=None)

Source from the content-addressed store, hash-verified

155 """A single validity line in progress."""
156
157 def __init__(self, text=None, anchor=None):
158 """Prepare to add a validity entry, optionally with a VUID anchor.
159
160 An anchor is generated by concatenating the elements of the anchor tuple with dashes
161 at the end of the VUID anchor name.
162 """
163 _checkAnchorComponents(anchor)
164 if isinstance(anchor, str):
165 # anchor needs to be a tuple
166 anchor = (anchor,)
167
168 # VUID does not allow special chars except ":"
169 if anchor is not None:
170 anchor = [(anchor_value.replace('->', '::').replace('.', '::')) for anchor_value in anchor]
171
172 self.anchor = anchor
173 self.parts = []
174 self.verbose = False
175 if text:
176 self.append(text)
177
178 def append(self, part):
179 """Append a part of a string.

Callers

nothing calls this directly

Calls 2

appendMethod · 0.95
_checkAnchorComponentsFunction · 0.85

Tested by

no test coverage detected