[orca/gnome-3-4] More work on bug 673556 - The new AT-SPI2 timeout errors need to be handled



commit 238bd1fb76e119b28596dffade3a39d87faba5f5
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Apr 10 09:52:46 2012 -0400

    More work on bug 673556 - The new AT-SPI2 timeout errors need to be handled

 src/orca/braille_generator.py |    8 ++++++--
 src/orca/generator.py         |   14 +++++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/src/orca/braille_generator.py b/src/orca/braille_generator.py
index fa55333..4dac26c 100644
--- a/src/orca/braille_generator.py
+++ b/src/orca/braille_generator.py
@@ -92,17 +92,21 @@ class BrailleGenerator(generator.Generator):
         except:
             focusedRegion = None
         for region in result:
+            try:
+                role = obj.getRole()
+            except:
+                role = None
             if isinstance(region, (braille.Component, braille.Text)) \
                and region.accessible == obj:
                 focusedRegion = region
                 break
             elif isinstance(region, braille.Text) \
-                 and obj.getRole() == pyatspi.ROLE_COMBO_BOX \
+                 and role == pyatspi.ROLE_COMBO_BOX \
                  and region.accessible.parent == obj:
                 focusedRegion = region
                 break
             elif isinstance(region, braille.Component) \
-                 and obj.getRole() == pyatspi.ROLE_TABLE_CELL \
+                 and role == pyatspi.ROLE_TABLE_CELL \
                  and region.accessible.parent == obj:
                 focusedRegion = region
                 break
diff --git a/src/orca/generator.py b/src/orca/generator.py
index c6ea588..dfb9279 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -183,8 +183,12 @@ class Generator:
         globalsDict = {}
         self._addGlobals(globalsDict)
         globalsDict['obj'] = obj
-        globalsDict['role'] = args.get('role', obj.getRole())
-
+        try:
+            globalsDict['role'] = args.get('role', obj.getRole())
+        except:
+            msg = 'Cannot generate presentation for: %s. Aborting'
+            debug.println(debug.LEVEL_FINEST, msg)
+            return result
         try:
             # We sometimes want to override the role.  We'll keep the
             # role in the args dictionary as a means to let us do so.
@@ -992,7 +996,11 @@ class Generator:
         empty array if the object has no such label.
         """
         result = []
-        if obj.getRole() == pyatspi.ROLE_RADIO_BUTTON:
+        try:
+            role = obj.getRole()
+        except:
+            role = None
+        if role == pyatspi.ROLE_RADIO_BUTTON:
             radioGroupLabel = None
             relations = obj.getRelationSet()
             for relation in relations:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]