[Grok-dev] Grok, Martian and class decorators

Jan-Wijbrand Kolman janwijbrand at gmail.com
Thu Jan 27 03:43:42 EST 2011


On 1/26/11 14:08 PM, Souheil CHELFOUH wrote:
> I need to add : this is very important to me :)
>
> 2011/1/25 Souheil CHELFOUH<trollfot at gmail.com>:
>> Hello Grok,
>>
>> Recently, as I tried to migrate Dolmen to Grok 1.3, I faced some problems.
>> Two packages of Dolmen use class decorators and, especially in
>> dolmen.menu, it creates problems with martian directives.
>> In dolmen.menu, I try to access the directive value of the class being
>> decorated. While it used to work on martian 0.11.x, it no longer
>> works.
>> We investigated the problem with J-W and Matthias and we concluded
>> that Martian is not longer "class decorated safe".
>> It never claimed to be, obviously, but this is a real problem for me,
>> as these packages are an important brick or the Dolmen stack, for me.
>> What should we do ?

The more I think about this, the less I see a solution: directives do 
their work at import-time as do class decorators. In other words, like 
it is not possible to get values through a directive in another 
directive (as the import-time has not finished yet), class decorators 
cannot get values through directives either.

After import-time comes grokking-time. During grokking-time, annotations 
left by the directives can be read from the grokked components.

So *maybe* there is a solution, being, have the class decorators 
annotate the decorated components and use a grokker (registered for a 
very generic component type, `object` perhaps, would that work?) read 
that information and do the registrations.

Would this provide a way forward?

regards, jw



More information about the Grok-dev mailing list