[Zope-CVS] CVS: Products/Basket - __init__.py:1.16 utils.py:1.21
Chris McDonough
chrism at plope.com
Wed Nov 9 17:31:43 EST 2005
Update of /cvs-repository/Products/Basket
In directory cvs.zope.org:/tmp/cvs-serv13293
Modified Files:
__init__.py utils.py
Log Message:
Test failure modes.
=== Products/Basket/__init__.py 1.15 => 1.16 ===
--- Products/Basket/__init__.py:1.15 Wed Nov 9 16:45:45 2005
+++ Products/Basket/__init__.py Wed Nov 9 17:31:12 2005
@@ -29,6 +29,8 @@
def initialize(self, context):
context.registerClass(EggProduct, constructors = (('dummy',None),),
visibility=None, icon='icon_egg.gif')
+ # Grab app from Zope product context
+ # It's a "protected" attribute, hence the name mangling
app = context._ProductContext__app
debug_mode = App.config.getConfiguration().debug_mode
@@ -43,13 +45,23 @@
data = []
points = pkg_resources.iter_entry_points(entrypoint_group)
- # Grab app from Zope product context
- # It's a "protected" attribute, hence the name mangling
meta_types = []
+
for point in points:
# XXX deal with duplicate product names by raising an exception
# somewhere in here.
- product_pkg = get_containing_package(point.module_name)
+ try:
+ product_pkg = get_containing_package(point.module_name)
+ except:
+ if debug_mode:
+ raise
+ else:
+ zLOG.LOG('Egg Product Init', zLOG.ERROR,
+ 'Problem initializing product with entry point '
+ '%s in module %s' % (point.name,point.module_name),
+ error=sys.exc_info())
+ continue
+
productname = product_pkg.__name__.split('.')[-1]
initializer = get_initializer(point, productname, debug_mode)
context = EggProductContext(productname, initializer, app,
=== Products/Basket/utils.py 1.20 => 1.21 ===
--- Products/Basket/utils.py:1.20 Wed Nov 9 16:44:33 2005
+++ Products/Basket/utils.py Wed Nov 9 17:31:12 2005
@@ -446,8 +446,8 @@
except:
if log_exc:
- LOG('Zope',ERROR,'Couldn\'t install %s' % productname,
- error=sys.exc_info())
+ zLOG.LOG('Zope',zLOG.ERROR,'Couldn\'t install %s' % productname,
+ error=sys.exc_info())
transaction.abort()
if raise_exc:
raise
More information about the Zope-CVS
mailing list