INNER CODE UNIT · Python
attr
davidche1116/Sms · tool/device/dump_nodes.py:10
def attr(name):
mm = re.search(rf'{name}="([^"]*)"', node)
return mm.group(1) if mm else ""
text = attr("text")
desc = attr("content-desc")
bounds = attr("bounds")
clickable = attr("clickable")
cls = attr("class")
if clickable == "true" or text or desc:
print(f"{cls} click={clickable} text={text!r} desc={desc!r} {bounds}")