[orca] Handle yet more of the new timeout/hung errors from AT-SPI2



commit 2c4c9d1b61a07a899e4d4c7f9f92d1886bbd63c4
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Apr 10 08:56:54 2012 -0400

    Handle yet more of the new timeout/hung errors from AT-SPI2

 src/orca/generator.py       |    5 ++++-
 src/orca/scripts/default.py |    8 ++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/generator.py b/src/orca/generator.py
index 218d57a..c6ea588 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -644,7 +644,10 @@ class Generator:
 
         # Do not return yourself as a header.
         #
-        role = args.get('role', obj.getRole())
+        try:
+            role = args.get('role', obj.getRole())
+        except:
+            role = None
         if role in [pyatspi.ROLE_COLUMN_HEADER,
                     pyatspi.ROLE_TABLE_COLUMN_HEADER]:
             return result
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 05c42de..21e38d7 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -1333,7 +1333,11 @@ class Script(script.Script):
 
             # [[[TODO: WDW - this should move to the generator.]]]
             #
-            if newLocusOfFocus.getRole() == pyatspi.ROLE_LINK:
+            try:
+                newRole = newLocusOfFocus.getRole()
+            except:
+                newRole = None
+            if newRole == pyatspi.ROLE_LINK:
                 voice = self.voices[settings.HYPERLINK_VOICE]
             else:
                 voice = self.voices[settings.DEFAULT_VOICE]
@@ -1347,7 +1351,7 @@ class Script(script.Script):
             # information in the table cell's table, so that we can use
             # it the next time.
             #
-            if newLocusOfFocus.getRole() == pyatspi.ROLE_TABLE_CELL:
+            if newRole == pyatspi.ROLE_TABLE_CELL:
                 try:
                     table = newParent.queryTable()
                 except:



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