[Grok-dev] Re: big grok refactoring

Philipp von Weitershausen philipp at weitershausen.de
Wed Feb 7 10:10:07 EST 2007

Jan-Wijbrand Kolman wrote:
>> I spoke too fast, I just realized that grokking a package would also
>> grok meta.py and this would re-grok the grokkers. It may not be harmful
>> in operation as those grokkers would just be re-registered, but not 
>> pretty.
> (reviving an older discussion)
> It's not pretty indeed: now that my application defines its own
> grokker, this grokker is registered twice: first while grokking my
> meta.py (triggered from my meta.zcml) and then again during 'normal'
> grok time. As a result, the component I'm grokking is doing its work
> twice.
> I wonder if the solution is not rather simple (but then again, I might
> not see its implications). Here's a proposal for a small patch. Would
> this work?

Looks like it.

> Tests pass, my grokker is only registered once and thus my components 
> are too.

Cool. Can you also write a test in grok/tests/grokker that tests this? 
Then I'll be happy to apply the patch.

http://worldcookery.com -- Professional Zope documentation and training
Next Zope 3 training at Camp5: http://trizpug.org/boot-camp/camp5

More information about the Grok-dev mailing list