[orca] Fix for bgo#610134 - Missing liblouis information can cause Orca to stop presenting



commit b8e6e6adf061e7f47015ba4b7b9a2a270cd73fec
Author: Willie Walker <wwalker gnome org>
Date:   Tue Feb 16 11:52:42 2010 -0500

    Fix for bgo#610134 - Missing liblouis information can cause Orca to stop presenting

 src/orca/braille.py        |   22 +++++++++++++++++++++-
 src/orca/orca_gui_prefs.py |    3 +++
 2 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/braille.py b/src/orca/braille.py
index ac75568..6b8fbf9 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -69,8 +69,28 @@ import debug
 import eventsynthesizer
 import orca_state
 import settings
-from platform import tablesdir
 
+# Right now, the orca autogen.sh/configure needs a priori knowledge of
+# where the liblouis tables are.  When running autogen.sh/configure,
+# platform.py:tablesdir will be set to point to the liblouis table
+# location.  If not found, it will be the empty string.  We need to
+# capture that error condition, otherwise braille contraction will
+# just plain fail.  See also bgo#610134.  [[TODO: WDW - see if the
+# liblouis bindings can give us the tablesdir information at runtime
+# http://code.google.com/p/liblouis/issues/detail?id=9]]
+#
+from platform import tablesdir
+if louis and not tablesdir:
+    debug.println(debug.LEVEL_SEVERE,
+                  "Contraction tables for liblouis cannot be found.")
+    debug.println(debug.LEVEL_SEVERE,
+                  "This usually means orca was built before")
+    debug.println(debug.LEVEL_SEVERE,
+                  "liblouis was installed. Contracted braille will")
+    debug.println(debug.LEVEL_SEVERE,
+                  "not be available.")
+    louis = None
+    
 from orca_i18n import _                          # for gettext support
 
 # The braille monitor
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index 8518a72..6d6dd37 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -57,6 +57,9 @@ try:
     import louis
 except ImportError:
     louis = None
+from platform import tablesdir
+if louis and not tablesdir:
+    louis = None
 
 from orca_i18n import _  # for gettext support
 from orca_i18n import C_ # to provide qualified translatable strings



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