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

Function getElemName

scripts/spec_tools/util.py:8–14  ·  view source on GitHub ↗

Get the name associated with an element, either a name child or name attribute.

(elem, default=None)

Source from the content-addressed store, hash-verified

6
7
8def getElemName(elem, default=None):
9 """Get the name associated with an element, either a name child or name attribute."""
10 name_elem = elem.find('name')
11 if name_elem is not None:
12 return name_elem.text
13 # Fallback if there is no child.
14 return elem.get('name', default)
15
16
17def getElemType(elem, default=None):

Calls 1

getMethod · 0.45

Tested by

no test coverage detected