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 me. > 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: "Products.MyProduct/skins/my_skin" "some.long.package/skins/my_skin" 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 :/ Thanks, Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests