[Grok-dev] five.grok and static resource directory

Godefroid Chapelle gotcha at bubblenet.be
Tue Aug 26 06:33:03 EDT 2008


Sylvain Viollon wrote:
> 
> Hello,
> 
>    I make the static resource directory work under Zope 2 in five.grok
> this week-end, in a branch of it. This works quite well.
> 
>    But I still have a problem, because basically I need to replace the
> registered DirectoryResourceFactory of Zope 3 by the one of Five, but I
> don't see how to overrides the grokker which do it in grokcore.view.
> 
>    There is two way I think to fix that:
> 
>    - To move back the StaticGrokker to the grok package, so I can
> create one in five.grok which don't conflict with it.
> 
>    - To set different priority on both grokkers, the one in
> five.grok will have on higher, and the on in grokcore.view will
> register the resource directory only if there is no registration done
> yet.
> 
>    I prefer the first one, because it's cleaner I think, but that's
> means if people use grokcore.view without grok or five.grok, they are
> not going to have a static resource directory registered.
> 
>    If you can give me your opinion, I would like to merge the branches
> I have made with trunk, because I would like to use this feature !
> 
> 
>    Best regards,
> 
>    Sylvain,

I see a third way :

To cut grocore.view meta.py into pieces.
Those pieces would all be grokked by grokcore.view meta.zcml

This way, five.grok would be able to decide what it needs to grok 
instead of including blindly grokcore.view meta.zcml. (If we keep 
grokcore.view meta.py as a single piece, there is no way to separate 
what should be grokked in five.grok from what should not be grokked.)

HTH
-- 
Godefroid Chapelle (aka __gotcha) http://bubblenet.be


More information about the Grok-dev mailing list