conduit r1278 - in trunk: . conduit



Author: jstowers
Date: Wed Feb  6 09:57:04 2008
New Revision: 1278
URL: http://svn.gnome.org/viewvc/conduit?rev=1278&view=rev

Log:
2008-02-06  John Stowers  <john stowers gmail com>

	* conduit/Web.py: Implement a better approach to lazy importing 
	gtkmozembed which fixes bug #512379.



Modified:
   trunk/ChangeLog
   trunk/conduit/Web.py

Modified: trunk/conduit/Web.py
==============================================================================
--- trunk/conduit/Web.py	(original)
+++ trunk/conduit/Web.py	Wed Feb  6 09:57:04 2008
@@ -2,6 +2,7 @@
 Functions for dealing with web urls, generally used for
 logging into web sites for authorization
 """
+import sys
 import os
 import gobject
 import webbrowser
@@ -77,10 +78,10 @@
     def __init__(self):
         _WebBrowser.__init__(self)
 
-        #lazy import
-        try:
-            gtkmozembed
-        except NameError:
+        #lazy import and other hoops necessary because
+        #set_profile path must be the first call to gtkmozembed
+        #after it is imported
+        if 'gtkmozembed' not in sys.modules:
             import gtkmozembed
             global gtkmozembed
             gtkmozembed.set_profile_path(get_profile_subdir('mozilla'), 'default')



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