Author: jmorliaguet
Date: Mon May 29 11:57:54 2006
New Revision: 3268

Modified:
   z3ecm/trunk/src/ecm/cpsskins/example4/actions.py
   z3ecm/trunk/src/ecm/cpsskins/example7/portlet.py

Log:

- more robust code, remove deprecation warning



Modified: z3ecm/trunk/src/ecm/cpsskins/example4/actions.py
==============================================================================
--- z3ecm/trunk/src/ecm/cpsskins/example4/actions.py    (original)
+++ z3ecm/trunk/src/ecm/cpsskins/example4/actions.py    Mon May 29 11:57:54 2006
@@ -19,7 +19,7 @@
 
 from persistent import Persistent
 from zope.app.publisher.browser.menu import getMenu
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.interface import implements
 from zope.schema import TextLine
 

Modified: z3ecm/trunk/src/ecm/cpsskins/example7/portlet.py
==============================================================================
--- z3ecm/trunk/src/ecm/cpsskins/example7/portlet.py    (original)
+++ z3ecm/trunk/src/ecm/cpsskins/example7/portlet.py    Mon May 29 11:57:54 2006
@@ -69,7 +69,11 @@
         return {'header': u'Please set the RSS feed URL', 'items': []}
 
     xml = parse(file)
-    channel_def = xml.getElementsByTagName('channel')[0]
+    channels_def = xml.getElementsByTagName('channel')
+    if len(channels_def) != 1:
+        return {'header': u'No channel found - check the URL', 'items': []}
+
+    channel_def = channels_def[0]
     channel_title = textOf(channel_def, 'title')
 
     items = []
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to