Fix minor bug when get a11y tree and linearize for agent
This commit is contained in:
@@ -45,15 +45,15 @@ def linearize_accessibility_tree(accessibility_tree):
|
|||||||
linearized_accessibility_tree += node.attrib.get('name') + "\t"
|
linearized_accessibility_tree += node.attrib.get('name') + "\t"
|
||||||
if node.text:
|
if node.text:
|
||||||
linearized_accessibility_tree += (node.text if '"' not in node.text else '"{:}"'.format(node.text.replace('"', '""'))) + "\t"
|
linearized_accessibility_tree += (node.text if '"' not in node.text else '"{:}"'.format(node.text.replace('"', '""'))) + "\t"
|
||||||
elif node.get("{uri:deskat:uia.windows.microsoft.org}class").endswith("EditWrapper")\
|
elif node.get("{uri:deskat:uia.windows.microsoft.org}class", "").endswith("EditWrapper")\
|
||||||
and node.get("{uri:deskat:value.at-spi.gnome.org}value"):
|
and node.get("{uri:deskat:value.at-spi.gnome.org}value"):
|
||||||
text: str = node.get("{uri:deskat:value.at-spi.gnome.org}value")
|
text: str = node.get("{uri:deskat:value.at-spi.gnome.org}value")
|
||||||
linearized_accessibility_tree += (text if '"' not in text else '"{:}"'.format(text.replace('"', '""'))) + "\t"
|
linearized_accessibility_tree += (text if '"' not in text else '"{:}"'.format(text.replace('"', '""'))) + "\t"
|
||||||
else:
|
else:
|
||||||
linearized_accessibility_tree += '""\t'
|
linearized_accessibility_tree += '""\t'
|
||||||
linearized_accessibility_tree += node.attrib.get(
|
linearized_accessibility_tree += node.attrib.get(
|
||||||
'{uri:deskat:component.at-spi.gnome.org}screencoord') + "\t"
|
'{uri:deskat:component.at-spi.gnome.org}screencoord', "") + "\t"
|
||||||
linearized_accessibility_tree += node.attrib.get('{uri:deskat:component.at-spi.gnome.org}size') + "\n"
|
linearized_accessibility_tree += node.attrib.get('{uri:deskat:component.at-spi.gnome.org}size', "") + "\n"
|
||||||
|
|
||||||
return linearized_accessibility_tree
|
return linearized_accessibility_tree
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user