ver Mar10th
changed AT element filtering
This commit is contained in:
4
at_processing/.gitignore
vendored
Normal file
4
at_processing/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/*.json
|
||||
/*.xml
|
||||
/*.list
|
||||
/*.png
|
||||
249
at_processing/filter.anal
Normal file
249
at_processing/filter.anal
Normal file
@@ -0,0 +1,249 @@
|
||||
vimc: hi AnalSecTitle term=bold cterm=bold:
|
||||
vimc: syn match AnalSecTitle /^|\d\+\.\ .*$/:
|
||||
vimc: syn match Comment /^#.*$/:
|
||||
vimc: hi AnalMetaInfo term=italic ctermfg=red:
|
||||
vimc: syn match AnalMetaInfo /^[A-Z]\:\ /:
|
||||
vimc: syn match Todo /\<TODO\>\|^I\:/:
|
||||
vimc: hi VIMC ctermfg=grey:
|
||||
vimc: syn match VIMC /^vimc\:\ .*\:$/:
|
||||
vimc: hi AnalComplete term=reverse,bold ctermfg=green:
|
||||
vimc: syn match AnalComplete /✓$/:
|
||||
vimc: hi AnalFail term=reverse,bold ctermfg=red:
|
||||
vimc: syn match AnalFail /✗$/:
|
||||
|
||||
vimc: hi AnalInfoElm term=reverse,bold ctermfg=cyan:
|
||||
vimc: syn match AnalInfoElm /\<i$/:
|
||||
|
||||
# 分析如何按照UFO的规则过滤AT元素
|
||||
|
||||
# E: 列出元素类型
|
||||
# P: 列出属性
|
||||
# R: 引用
|
||||
|
||||
UFO中保留的十一种元素类型:
|
||||
E: Button, Edit, TabItem, Document, ListItem, MenuItem, ScrollBar, TreeItem, Hyperlink, ComboBox, RadioButton
|
||||
|
||||
|1. GNOME上元素类型
|
||||
|
||||
R: ubuntu-tag.shrunk.list
|
||||
alert 3 ✓
|
||||
animation 29
|
||||
application 12
|
||||
canvas 6 ✓
|
||||
check-box 17 ✓
|
||||
check-menu-item 1263 ✓
|
||||
combo-box 19 ✓
|
||||
desktop-frame 1
|
||||
dialog 1
|
||||
document-frame 4 ✓
|
||||
document-presentation 1 ✓
|
||||
document-spreadsheet 1 ✓
|
||||
document-text 1 ✓
|
||||
document-web 10 ✓
|
||||
drawing-area 1
|
||||
embedded 1
|
||||
entry 8 ✓
|
||||
filler 264
|
||||
form 2
|
||||
frame 15
|
||||
heading 36 ✓
|
||||
icon 96 ✓
|
||||
image 246 ✓
|
||||
image-map 1
|
||||
internal-frame 10
|
||||
label 170 ✓
|
||||
landmark 12
|
||||
layered-pane 3
|
||||
link 315 ✓
|
||||
list 17
|
||||
list-box 7
|
||||
list-item 145 ✓
|
||||
menu 546
|
||||
menu-bar 12
|
||||
menu-item 2392 ✓
|
||||
notification 45
|
||||
page 21
|
||||
page-tab 16
|
||||
page-tab-list 9
|
||||
panel 362
|
||||
paragraph 42 ✓
|
||||
popup-menu 9
|
||||
push-button 612 ✓
|
||||
radio-button 28 ✓
|
||||
radio-menu-item 174 ✓
|
||||
root-pane 3
|
||||
ruler 1
|
||||
scroll-bar 46 ✓
|
||||
scroll-pane 28
|
||||
section 568 ✓
|
||||
separator 879
|
||||
slider 1 ✓
|
||||
split-pane 11
|
||||
static 76 ✓
|
||||
status-bar 7
|
||||
table 5
|
||||
table-cell 841 ✓
|
||||
table-column-header 42 ✓
|
||||
table-row 8
|
||||
terminal 1 ✓
|
||||
text 27 ✓
|
||||
toggle-button 123 ✓
|
||||
tool-bar 63
|
||||
tree 5
|
||||
tree-item 14 ✓
|
||||
tree-table 1
|
||||
unknown 9
|
||||
viewport 13
|
||||
|
||||
| 2. Windows上元素类型
|
||||
|
||||
R: windows-tag.list
|
||||
_wwf 1
|
||||
address-band-root 1
|
||||
backforwardbutton 1 ✓
|
||||
boxlayoutview 1
|
||||
breadcrumb-parent 1
|
||||
browserappmenubutton 1 ✓
|
||||
browsercaptionbuttoncontainer 1
|
||||
browserframeviewwin 1
|
||||
browserrootview 1
|
||||
browserview 1
|
||||
bubbledialogdelegateview 1
|
||||
bubbleframeview 1
|
||||
button 6 ✓
|
||||
cabinetwclass 1
|
||||
chrome_widgetwin_1 2
|
||||
consolewindowclass 1
|
||||
container 1
|
||||
desktop 1
|
||||
dialogclientview 1
|
||||
duilistview 1
|
||||
duiviewwndclassname 1
|
||||
dynamiccontent1 1
|
||||
dynamiccontent2 1
|
||||
edgeavatartoolbarbutton 1 ✓
|
||||
edgehubappstowerscreenshotbutton 1 ✓
|
||||
edgehubappstowerscrollview 1
|
||||
edgehubappstowertoggletoolbarbutton 10 ✓
|
||||
edgehubappstowerview 1
|
||||
edgenewtabbutton 1 ✓
|
||||
edgetab 2
|
||||
edgetabactionsmenubutton 1 ✓
|
||||
edgetabclosebutton 2 ✓
|
||||
edgetabcontainerimpl 1
|
||||
edgetabstrip 1
|
||||
edgetabstripregionview 1
|
||||
element 1
|
||||
excel- 2
|
||||
excel2 2
|
||||
framegrabhandle 1
|
||||
fullpageuihost 3
|
||||
hubtoggletoolbarbutton 3 ✓
|
||||
imemodebutton 1 ✓
|
||||
linevscrollbar 1 ✓
|
||||
locationbarview 1
|
||||
locationiconview 1
|
||||
mdiclient 1
|
||||
metadatalabel 1 ✓
|
||||
modernsearchbox 1 ✓
|
||||
msctls_progress32 1
|
||||
mstasklistwclass 1
|
||||
netuiappframehelper 12
|
||||
netuielement 3
|
||||
netuifullpageuiwindow 3
|
||||
netuihwnd 1
|
||||
netuihyperlink 3 ✓
|
||||
netuikeyboardtabelement 3 ✓
|
||||
netuilabel 9 ✓
|
||||
netuilistview 6
|
||||
netuilistviewitem 27 ✓
|
||||
netuiofficecaption 3
|
||||
netuioutspacebutton 3 ✓
|
||||
netuipanviewer 3
|
||||
netuiribbontab 15 ✓
|
||||
netuiscrollbar 6 ✓
|
||||
netuiscrollviewer 12
|
||||
netuisimplebutton 6 ✓
|
||||
netuislabcontainer 6
|
||||
netuislabexpandcollapsebutton 3 ✓
|
||||
netuitabheader 6 ✓
|
||||
nonclientview 2
|
||||
nuipane 1
|
||||
omniboxviewviews 1
|
||||
opusapp 1
|
||||
pageactioniconcontainerview 1
|
||||
pageactioniconview 1
|
||||
pptframeclass 1
|
||||
progman 1
|
||||
propertreehost 1
|
||||
rebarwindow32 1
|
||||
reloadbutton 1 ✓
|
||||
rootview 1
|
||||
scrollview 1
|
||||
scrollview--viewport 1
|
||||
selectorbutton 2 ✓
|
||||
selectornodefault 1
|
||||
separator 2
|
||||
separatorband 2
|
||||
shell_traywnd 1
|
||||
shelltabwindowclass 1
|
||||
sidebarcontentssplitview 5
|
||||
splitwindowcontainerview 1
|
||||
start 1 ✓
|
||||
starview 1
|
||||
statusbarmoduleinner 1
|
||||
syslistview32 1
|
||||
syspager 1
|
||||
systreeview32 1
|
||||
tabstrip--edgetabdragcontextimpl 1
|
||||
textfield 1 ✓
|
||||
toolbarhubiconcontainerview 1
|
||||
toolbarsplitwindowbutton 1 ✓
|
||||
toolbarview 1
|
||||
toolbarview--containerview 1
|
||||
toolbarwindow32 5
|
||||
topcontaineroverlayview 1
|
||||
topcontainerview 1
|
||||
towerhubiconcontainerview 1
|
||||
travelband 1
|
||||
traybutton 2 ✓
|
||||
trayclockwclass 1 ✓
|
||||
traydummysearchcontrol 1 ✓
|
||||
trayinputindicatorwclass 1
|
||||
traynotifywnd 1
|
||||
trayshowdesktopbuttonwclass 1
|
||||
uicolumnheader 4
|
||||
uiimage 24 ✓
|
||||
uiitem 24 ✓
|
||||
uiitemsview 1
|
||||
uiproperty 96 ✓
|
||||
uiribboncommandbar 1 ✓
|
||||
uiribboncommandbardock 1
|
||||
uiribbonworkpane 1
|
||||
uiviewheader 1 ✓
|
||||
universalsearchband 1
|
||||
unknown 92
|
||||
upband 1
|
||||
view 7
|
||||
windowedfindbarfocusproxyview 1
|
||||
windowscaptionbutton 3 ✓
|
||||
worker-window 1
|
||||
xldesk 1
|
||||
xlmain 1
|
||||
|
||||
|3. 筛选属性
|
||||
|
||||
UFO中筛选的几种元素属性:
|
||||
P: is_visible, is_enabled, title_list, class_name_list
|
||||
|
||||
对Ubuntu,照葫芦画瓢,筛选
|
||||
P: visible & showing
|
||||
P: enabled
|
||||
P: name
|
||||
P: text
|
||||
|
||||
对Windows,筛选
|
||||
P: visible
|
||||
P: enabled
|
||||
P: name
|
||||
P: text
|
||||
22
at_processing/ubuntu_node_statistics.py
Normal file
22
at_processing/ubuntu_node_statistics.py
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import lxml.etree
|
||||
from lxml.etree import _Element
|
||||
from typing import Counter
|
||||
import json
|
||||
import collections
|
||||
|
||||
file_name = "w0"
|
||||
|
||||
with open("{:}.json".format(file_name)) as f:
|
||||
xml_str: str = json.load(f)["AT"]
|
||||
root: _Element = lxml.etree.fromstring(xml_str)
|
||||
with open("{:}.xml".format(file_name), "w") as f:
|
||||
f.write(lxml.etree.tostring(root, encoding="unicode", pretty_print=True))
|
||||
#root: _Element = lxml.etree.parse("{:}.xml".format(file_name)).getroot()
|
||||
node_types: Counter[str] = collections.Counter()
|
||||
for n in root.iter():
|
||||
node_types[n.tag] += 1
|
||||
|
||||
for n in sorted(node_types):
|
||||
print(n, node_types[n])
|
||||
Reference in New Issue
Block a user