[Zope-CMF] Re: Adding python packages to ProductsPath

yuppie y.2007- at wcm-solutions.de
Tue Jan 23 12:55:58 EST 2007


Hi Wichert!


Wichert Akkerman wrote:
> At the moment it is not possible to use skin layers in pure python
> packages. This is caused by the DirectoryView implementation using
> a minimal path name for the layer id. This path name is created
> by CMFCore.utils.minimalpath, which uses the ProductsPaths list of
> directories to look for the filesystem directory and uses an absolute
> path if it can't find it. Since this absolute path will differ per
> install you can't use it in something like genericsetup profiles.
> 
> The patch below fixes this by adding $INSTANCE_HOME/lib/python to the
> ProductsPaths list. This allows minimalpath to find python packages installed
> there.
> 
> Are there any objections to commiting this to trunk?

Yes, I object. This is a hack that resolves the issue just for some 
special use cases. We need a solution that works with python packages 
anywhere in the python path.

Please read this thread:
http://mail.zope.org/pipermail/zope-cmf/2006-July/024631.html

And please note that we just need a human readable registry key, nothing 
that allows to look up the directories directly.

Different keys are possible, e.g.:

   Products.MyProduct/skins/my_skin
   MyPackage.MySubPackage/skins/my_skin

   Products/MyProduct/skins/my_skin
   MyPackage/MySubPackage/skins/my_skin

   Products.MyProduct:skins/my_skin
   MyPackage.MySubPackage:skins/my_skin

   Products.MyProduct:my_skin
   MyPackage.MySubPackage:my_skin

I think the old keys should become deprecated and replaced everywhere.


Cheers,

	Yuppie



More information about the Zope-CMF mailing list