orca r4130 - in trunk: . src/orca



Author: wwalker
Date: Tue Aug 26 14:39:51 2008
New Revision: 4130
URL: http://svn.gnome.org/viewvc/orca?rev=4130&view=rev

Log:
Refix for bug #540937 - Orca doesn't check if the wnck python bindings are installed.


Modified:
   trunk/ChangeLog
   trunk/src/orca/mouse_review.py

Modified: trunk/src/orca/mouse_review.py
==============================================================================
--- trunk/src/orca/mouse_review.py	(original)
+++ trunk/src/orca/mouse_review.py	Tue Aug 26 14:39:51 2008
@@ -25,7 +25,16 @@
 __copyright__ = "Copyright (c) 2008 Eitan Isaacson"
 __license__   = "LGPL"
 
-import wnck
+import debug
+
+try:
+    import wnck
+    _mouseReviewCapable = True
+except:
+    debug.println(debug.LEVEL_WARNING, \
+                  "Python module wnck not found, mouse review not available.")
+    _mouseReviewCapable = False
+
 import gtk
 import gobject
 
@@ -134,6 +143,9 @@
     def __init__(self):
         """Initalize a mouse reviewer class.
         """
+        if not _mouseReviewCapable:
+            return
+
         # Need to do this and allow the main loop to cycle once to get any info
         wnck_screen = wnck.screen_get_default()
         self.active = False
@@ -147,6 +159,9 @@
         Arguments:
         - on: If set to True or False, explicitly toggles reviewing on or off.
         """
+        if not _mouseReviewCapable:
+            return
+
         if on is None:
             on = not self.active
         if on and not self.active:



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