[Grok-dev] Grok, Martian and class decorators

Vincent Fretin vincent.fretin at gmail.com
Sat Jan 29 11:58:00 EST 2011


 On Thu, Jan 27, 2011 at 9:43 AM, Jan-Wijbrand Kolman <janwijbrand at gmail.com
> wrote:

> 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
>
>
Hi,

Maybe http://pypi.python.org/pypi/venusian
can help here?

Regards
Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20110129/17d56fc4/attachment.html 


More information about the Grok-dev mailing list