deskbar-applet r1922 - in trunk: . deskbar/handlers



Author: sebp
Date: Sat Feb  9 14:48:03 2008
New Revision: 1922
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=1922&view=rev

Log:
Fixed bug #450960: Exception in epiphany module

Modified:
   trunk/ChangeLog
   trunk/deskbar/handlers/epiphany.py

Modified: trunk/deskbar/handlers/epiphany.py
==============================================================================
--- trunk/deskbar/handlers/epiphany.py	(original)
+++ trunk/deskbar/handlers/epiphany.py	Sat Feb  9 14:48:03 2008
@@ -1,11 +1,14 @@
-import xml.sax
-from os.path import join, expanduser, exists
-from gettext import gettext as _
-import deskbar, deskbar.core.Indexer, deskbar.interfaces.Module
-from deskbar.core.Watcher import FileWatcher
-from deskbar.core.BrowserMatch import get_url_host, is_preferred_browser, on_customize_search_shortcuts, on_entry_key_press, load_shortcuts
 from deskbar.core.BrowserMatch import BrowserSmartMatch, BrowserMatch
+from deskbar.core.BrowserMatch import get_url_host, is_preferred_browser, on_customize_search_shortcuts, on_entry_key_press, load_shortcuts
+from deskbar.core.Watcher import FileWatcher
 from deskbar.defs import VERSION
+from gettext import gettext as _
+from os.path import join, expanduser, exists
+import deskbar, deskbar.core.Indexer, deskbar.interfaces.Module
+import xml.sax
+import logging
+
+LOGGER = logging.getLogger(__name__)
 
 EPHY_BOOKMARKS_FILE = expanduser("~/.gnome2/epiphany/bookmarks.rdf")
 EPHY_HISTORY_FILE   = expanduser("~/.gnome2/epiphany/ephy-history.xml")
@@ -73,9 +76,6 @@
         
     @staticmethod
     def has_requirements():
-        #    if deskbar.UNINSTALLED_DESKBAR:
-        #        return (deskbar.Handler.HANDLER_IS_HAPPY, None, None)
-            
         if is_preferred_browser("epiphany"):
             return True
         else:
@@ -155,9 +155,6 @@
     
     @staticmethod    
     def has_requirements():
-        #    if deskbar.UNINSTALLED_DESKBAR:
-        #        return (deskbar.Handler.HANDLER_IS_HAPPY, None, None)
-        
         if is_preferred_browser("epiphany"):
             return True
         else:
@@ -197,7 +194,11 @@
         if exists(EPHY_BOOKMARKS_FILE):
             parser = xml.sax.make_parser()
             parser.setContentHandler(self)
-            parser.parse(EPHY_BOOKMARKS_FILE)
+            try:
+                parser.parse(EPHY_BOOKMARKS_FILE)
+            except xml.sax.SAXParseException, e:
+                LOGGER.error("Could not parse epiphany bookmarks file")
+                LOGGER.exception(e)
     
     def characters(self, chars):
         self.chars = self.chars + chars



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