[orca/570658-whereami] Modify _generatePositionInList to deal with dojo trees.
- From: Joanmarie Diggs <joanied src gnome org>
- To: svn-commits-list gnome org
- Subject: [orca/570658-whereami] Modify _generatePositionInList to deal with dojo trees.
- Date: Tue, 9 Jun 2009 09:09:51 -0400 (EDT)
commit ac302d9be14ec32816abeccb58ada53c4c3a903e
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date: Tue Jun 9 09:05:17 2009 -0400
Modify _generatePositionInList to deal with dojo trees.
---
src/orca/speech_generator.py | 13 ++++++++++++-
test/keystrokes/firefox/dojo_tree.py | 5 ++---
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 13649d5..3ffedd4 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1882,7 +1882,18 @@ class SpeechGenerator:
for relation in obj.getRelationSet():
if relation.getRelationType() == \
pyatspi.RELATION_NODE_CHILD_OF:
- parent = relation.getTarget(0)
+ # getChildNodes assumes that we have an accessible table
+ # interface to work with. If we don't, it will fail. So
+ # don't set the parent until verifying the interface we
+ # expect actually exists.
+ #
+ target = relation.getTarget(0)
+ try:
+ target.parent.queryTable()
+ except:
+ pass
+ else:
+ parent = target
break
obj = parent
diff --git a/test/keystrokes/firefox/dojo_tree.py b/test/keystrokes/firefox/dojo_tree.py
index fa006d9..ca435ee 100644
--- a/test/keystrokes/firefox/dojo_tree.py
+++ b/test/keystrokes/firefox/dojo_tree.py
@@ -60,10 +60,9 @@ sequence.append(KeyComboAction("KP_Enter"))
sequence.append(PauseAction(3000))
sequence.append(utils.AssertPresentationAction(
"basic whereAmI",
- ["BUG? - Not speaking the item count",
- "BRAILLE LINE: 'Africa ListItem'",
+ ["BRAILLE LINE: 'Africa ListItem'",
" VISIBLE: 'Africa ListItem', cursor=1",
- "SPEECH OUTPUT: 'list item Africa collapsed tree level 2'"]))
+ "SPEECH OUTPUT: 'list item Africa item 1 of 6 collapsed tree level 2'"]))
########################################################################
# Use arrows to expand/collapse/navigate tree.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]