Merge pull request #31 from zhao-george/master

fix: 修复dogtail获取application阻塞问题
This commit is contained in:
mikigo 2024-01-26 13:34:18 +08:00 committed by GitHub
commit d1375fb4d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -114,6 +114,10 @@ class _Config(object):
logDebugToStdOut (boolean):
Whether to print log output to console or not (default True).
reversed (boolean):
When traversing nodes, is reverse iteration adopted?(default False).
"""
@property
def scriptName(self):
@ -158,7 +162,10 @@ class _Config(object):
'checkForA11y': True,
# Logging
'logDebugToFile': True
'logDebugToFile': True,
# reversed
'reversed': True
}
options = {}

View File

@ -888,7 +888,10 @@ class Node(object):
pred = lambda n: orig_pred(n) and \
n.getState().contains(pyatspi.STATE_SHOWING)
if not recursive:
cIter = iter(self)
if config.reversed is False:
cIter = iter(self)
else:
cIter = reversed(self)
while True:
try:
child = next(cIter)