[Grok-dev] Grokking Order
Paul Wilson
paulalexwilson at gmail.com
Fri Jan 2 07:33:40 EST 2009
2009/1/1 Paul Wilson <paulalexwilson at gmail.com>:
> 2008/12/31 Santiago Videla <santiago.videla at gmail.com>:
>> Hi there,
>>
>> I`m not sure, but maybe you could take a look at the GlobalUtility grokker
>> (1) to see the priority and set a lower priority in your custom grokker
>
> I did look at that actually, it's set to 1100. I think the priority
> differentiates classes within the same module - my global utility is
> defined in a different module from my add-on classes.
>
> I think I'll have to rethink my approach
I've added a print statement to by GlobalUtility to see if an instance
has been created; it has - *before* the ComponentLookupError exception
has been raised.
To recap - I have a GlobalUtility that will be serving as a container
for custom grokked classes. I've got grokkers for these custom classes
using component.getUtility(IMyInterface) to get my GlobalUtility so
that they can be placed inside it, but I'm receiving a
ComponentLookupError. However, an instance of my GlobalUtility is
apparently being created. It seems like Grok is waiting for all
components to be grokked before enabling the component architecture.
If the component architecture is indeed unusable like this, is there a
way instead to hook into Grok's start up such that I can gather all my
customer classes together (they're all MultiAdapters), and register
them in my global container utility *after* grokking has completed?
Thanks in advance,
Paul
More information about the Grok-dev
mailing list