Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
dogtail
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
2
Merge Requests
2
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dogtail
dogtail
Commits
6817c167
Commit
6817c167
authored
Nov 02, 2020
by
kuchune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add search AccessibleValue-related properties with description
parent
35fcc29d
Pipeline
#211196245
failed with stages
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
dogtail/predicate.py
dogtail/predicate.py
+6
-2
dogtail/tree.py
dogtail/tree.py
+2
-2
setup.py
setup.py
+7
-7
No files found.
dogtail/predicate.py
View file @
6817c167
...
...
@@ -104,15 +104,19 @@ class Predicate(object):
class
IsAnApplicationNamed
(
Predicate
):
"""Search subclass that looks for an application by name"""
def
__init__
(
self
,
appName
):
def
__init__
(
self
,
appName
,
description
=
None
):
self
.
appName
=
TranslatableString
(
appName
)
self
.
debugName
=
self
.
describeSearchResult
()
self
.
satisfiedByNode
=
self
.
_genCompareFunc
()
self
.
description
=
TranslatableString
(
description
)
def
_genCompareFunc
(
self
):
def
satisfiedByNode
(
node
):
try
:
return
node
.
roleName
==
'application'
and
stringMatches
(
self
.
appName
,
node
.
name
)
if
self
.
description
==
None
:
return
node
.
roleName
==
'application'
and
stringMatches
(
self
.
appName
,
node
.
name
)
else
:
return
node
.
roleName
==
'application'
and
stringMatches
(
self
.
appName
,
node
.
name
)
and
stringMatches
(
self
.
description
,
node
.
description
)
except
GLib
.
GError
as
e
:
if
re
.
match
(
r
"name :[0-9]+\.[0-9]+ was not provided"
,
e
.
message
):
logger
.
log
(
"Dogtail: warning: omiting possibly broken at-spi application record"
)
...
...
dogtail/tree.py
View file @
6817c167
...
...
@@ -1170,7 +1170,7 @@ class Root (Node):
"""
return
root
.
findChildren
(
predicate
.
GenericPredicate
(
roleName
=
"application"
),
recursive
=
False
,
showingOnly
=
False
)
def
application
(
self
,
appName
,
retry
=
True
):
def
application
(
self
,
appName
,
description
=
''
,
retry
=
True
):
"""
Gets an application by name, returning an Application instance
or raising an exception.
...
...
@@ -1179,7 +1179,7 @@ class Root (Node):
if no such child is found, and will eventually raise an exception. It
also logs the search.
"""
return
root
.
findChild
(
predicate
.
IsAnApplicationNamed
(
appName
),
recursive
=
False
,
retry
=
retry
,
showingOnly
=
False
)
return
root
.
findChild
(
predicate
.
IsAnApplicationNamed
(
appName
,
description
),
recursive
=
False
,
retry
=
retry
,
showingOnly
=
False
)
class
Application
(
Node
):
...
...
setup.py
View file @
6817c167
...
...
@@ -79,16 +79,16 @@ Vitezslav Humpa <vhumpa@redhat.com>""",
packages
=
[
'dogtail'
],
scripts
=
scripts
(),
data_files
=
[
(
'share/doc/dogtail/examples'
,
(
'
EGG-INFO/
share/doc/dogtail/examples'
,
examples
()),
(
'share/doc/dogtail/examples/data'
,
(
'
EGG-INFO/
share/doc/dogtail/examples/data'
,
examples_data
()),
(
'share/doc/dogtail/tests'
,
(
'
EGG-INFO/
share/doc/dogtail/tests'
,
tests
()),
(
'share/dogtail/glade'
,
[
'sniff/sniff.ui'
]),
(
'share/dogtail/icons'
,
sniff_icons
()),
(
'share/applications'
,
[
'sniff/sniff.desktop'
]),
(
'share/icons/hicolor/scalable/apps'
,
icons
(
'svg'
))
(
'
EGG-INFO/
share/dogtail/glade'
,
[
'sniff/sniff.ui'
]),
(
'
EGG-INFO/
share/dogtail/icons'
,
sniff_icons
()),
(
'
EGG-INFO/
share/applications'
,
[
'sniff/sniff.desktop'
]),
(
'
EGG-INFO/
share/icons/hicolor/scalable/apps'
,
icons
(
'svg'
))
],
options
=
{
'build_scripts'
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment