Author: jmorliaguet
Date: Thu Dec  8 21:36:27 2005
New Revision: 1999

Modified:
   cpsskins/branches/jmo-perspectives/setup/registration.py
Log:

- more robust refresh



Modified: cpsskins/branches/jmo-perspectives/setup/registration.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/setup/registration.py    (original)
+++ cpsskins/branches/jmo-perspectives/setup/registration.py    Thu Dec  8 
21:36:27 2005
@@ -22,6 +22,7 @@
 import logging
 
 from xml.dom.minidom import parse
+from xml.parsers.expat import ExpatError
 
 from zope.component import queryUtility, getUtility
 from zope.component.interfaces import IFactory
@@ -30,6 +31,7 @@
 from cpsskins.setup.interfaces import ISetting, IResource
 
 DEBUG = logging.DEBUG
+WARN = logging.WARN
 logger = logging.getLogger()
 
 filenames = []
@@ -80,7 +82,12 @@
     if not filename:
         raise TypeError("The setting is not a file-system setting.")
 
-    dom = parse(filename)
+    try:
+        dom = parse(filename)
+    except ExpatError:
+        logger.log(WARN, "could not parse %s. not reloading" % filename)
+        return
+
     for setting_node in dom.getElementsByTagName('setting'):
         if setting_node.getAttribute('name') != name:
             continue
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to