diff --git a/at_processing/filter.anal b/at_processing/filter.anal index 98fc1fe..9e3ba1d 100644 --- a/at_processing/filter.anal +++ b/at_processing/filter.anal @@ -231,6 +231,8 @@ worker-window 1 xldesk 1 xlmain 1 +TODO: 对Windows元素,可能按win:class属性筛选会更贴近UFO的方案。 + |3. 筛选属性 UFO中筛选的几种元素属性: @@ -238,7 +240,7 @@ P: is_visible, is_enabled, title_list, class_name_list 对Ubuntu,照葫芦画瓢,筛选 P: visible & showing -P: enabled +P: enabled | editable | expandable | checkable P: name P: text diff --git a/mm_agents/accessibility_tree_wrap/heuristic_retrieve.py b/mm_agents/accessibility_tree_wrap/heuristic_retrieve.py index 337b402..34a1d76 100644 --- a/mm_agents/accessibility_tree_wrap/heuristic_retrieve.py +++ b/mm_agents/accessibility_tree_wrap/heuristic_retrieve.py @@ -55,12 +55,12 @@ def judge_node(node: ET, platform="ubuntu") -> bool: or platform=="windows"\ and node.get("{{{:}}}visible".format(state_ns), "false")=="true"\ )\ - and ( node.get("{{{:}}}enabled".format(state_ns), "false")=="true"\ - or node.get("{{{:}}}editable".format(state_ns), "false")=="true"\ - or node.get("{{{:}}}expandable".format(state_ns), "false")=="true"\ - or node.get("{{{:}}}checkable".format(state_ns), "false")=="true" - )\ - and (node.get("name", "") != "" or node.text is not None and len(node.text)>0) + and ( node.get("{{{:}}}enabled".format(state_ns), "false")=="true"\ + or node.get("{{{:}}}editable".format(state_ns), "false")=="true"\ + or node.get("{{{:}}}expandable".format(state_ns), "false")=="true"\ + or node.get("{{{:}}}checkable".format(state_ns), "false")=="true" + )\ + and (node.get("name", "") != "" or node.text is not None and len(node.text)>0) coordinates: Tuple[int, int] = eval(node.get("{{{:}}}screencoord".format(component_ns), "(-1, -1)")) sizes: Tuple[int, int] = eval(node.get("{{{:}}}size".format(component_ns), "(-1, -1)"))