[z3-five] alphabetical order, skins and layers

Jan-Wijbrand Kolman jw at infrae.com
Thu Apr 28 09:14:58 CEST 2005


Hello,


I think I found a little problem in how Five loads the configure.zcml of
Products. As I understand, by default, Five will retrieve a Product listing of
the Zope instance used and looks inside the Products directory to see if there's
configure.zcml.

Now, if Product "Y" defines a set of layers, that Product "A" likes to reuse in
its own skin, loading the configure.zcml of Product "A" fails with a
configuration error:

  zope.configuration.config.ConfigurationExecutionError: exceptions.ValueError:
    ('Undefined layers', [u'layer_defined_in_y'])

Apparently, the alphabetical order of the installed Products matter in this
case. I confirmed this by renaming Product "A" into "Z". Then, the configuration
went just fine.

I don't know if other configuration aspects might have the same problem.

There's one work-around: place a site.zcml in the Zope instance's .../etc/
directory. This will override Five's default "look in all Products for a
configure.zcml"-behaviour, and just load only what is defined in the site.zcml,
in that order.

This is nice and explicit maybe, but is not very Zope-2-ish where people are
used to drop in a Product in the .../Products directory and have it working.

Maybe we can solve this by introducing an optional "I depend on Product Y to be
configured before me"-attribute defined in the Product's __init__.py or
something? Or maybe there's other ways?

Personally I hope we can get around this soon, have it in Five-1.0.1 and get
this in Zope-2.8... Or better even, that I did something wrong or overlooked
some way to prevent this alphabetical order issue all together.


Any ideas/comments?


kind regards,
jw

-- 
Jan-Wijbrand Kolman
jw at infrae.com


More information about the z3-five mailing list