[Zope-CMF] Re: DirectoryView, GenericSetup/skins, CMF 2.1

Rocky Burt rocky at serverzen.com
Sun Jul 9 08:41:01 EDT 2006

Hi Yuppie!

On Sun, 2006-09-07 at 13:46 +0200, yuppie wrote:
> +1 for fixing this, but may I suggest another approach?
> 'minimal_fp' is a registry key created by 'utils.minimalpath'. Right now 
> 'DirectoryView._dirpath' contains this registry key and I'd prefer to 
> keep it like that.

This is fine.  I'd have to admit I don't totally grok all of the
implementation details for DirectoryView and the registry at this point.
So anything that more properly "fits" the current design gets a +1 from

> The keys generated by 'utils.minimalpath' currently look like this:
>    "MyProduct/skins/my_skin"
>    "full/path/to/MyPackage/skins/my_skin"
> But we could change 'utils.minimalpath' to generate keys like these:
>    "Products/MyProduct/skins/my_skin"
>    "MyPackage/skins/my_skin"

If we're changing how the keys look, why not simply use full package
names in front with relative paths after the first slash (although I
might prefer a colon or something in place of the first slash).

So the new keys would be:

No need to make exception for Products in my opinion.  And the retrieval
logic would convert the first portion (before the first slash, or as I
mentioned earlier, perhaps a colon) into an absolute path based on the
actual package filesystem location.

> While it doesn't make sense to store 
> "full/path/to/MyPackage/skins/my_skin" in 'DirectoryView._dirpath' 
> "MyPackage/skins/my_skin" would work fine. All we need is a migration path.

Indeed.  But given my little knowledge at this point I'm not sure what
the migration path would look like.

> We can use the same pattern as for GenericSetup's registerProfile: 
> Omitting 'Products/' would become deprecated. For backwards 
> compatibility DirectoryInformations are first looked up with a 
> "Products/" prefix and if no DirectoryInformation is registered for that 
> key the plain 'DirectoryView._dirpath' is looked up.
> With this lookup order "MyPackage/skins/my_skin" is masked by 
> "Products/MyPackage/skins/my_skin", but I guess we can live without 
> support for that rare case until we remove the BBB code.

Well, if we switch to colon's to separate package from relative path
then we could still support the old and new way with no masking
necessary (ie "Products.MyProduct:skins/my_skin)

And since you understand the problem so well and it only took me about
20min yesterday to come up with my initial patch... any chance you could
implement the changes necessary for this?  Otherwise I'll have to
flounder about until I understand the minimal_fp thing a bit more :/


Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope-cmf/attachments/20060709/92f77c66/attachment.bin

More information about the Zope-CMF mailing list