[Grok-dev] solving the grok.template() bug - part A of the solution

Sylvain Viollon sylvain at infrae.com
Mon Jan 12 04:25:09 EST 2009


On Sun, 11 Jan 2009 21:34:59 +0100
Jan-Wijbrand Kolman <janwijbrand at gmail.com> wrote:

> Hi,
> 

   Hello,

> 
> With only slow progress I'm still working on the grok.template()
> issue.
> 

   I read part A and part B. I like part A, since there is not only
grok.template(), but I think grok.viewletmanager() which have the same
problem, and it's quite annoying as well. And I agree on the expected
behavior of CLASS_OR_MODULE, even if it's considered as 'complex'.

>
> [...]
>
> However, there're a couple of issues:
> 
> 1) Martian's tests use the FakeModule extensively to make tests a bit
> easier to read (one does not need to refer to the actual modules while
> reading the test cases). My implementation of finding the module of a
> baseclass breaks on the use of FakeModule.
> 
> I see two possible solutions: a) make FakeModule work with resolving
> modules from module names (although I did not see an easy way) or b)
> remove the FakeModule construct and define the test fixtures as normal
> modules again.
> 

  I would say 1) b), since it's better to keep things simple.

> 2) Even if we solve resolving modules in respect to FakeModule, what
> other situations can happen where a class's module cannot be resolved
> and which of these situations do we need to support?
> 
> 3) While studying martian's directive code it occurred to me that
> there's lots of methods that pass the module of a component around,
> essentially just to support the CLASS_OR_MODULE scope use case.
> 
> [...]
> 
> Additionally, the grok.context directive does things kinda different
> again since it has its own special UnambiguousComponentScope
> implementation[2]. I think this a sign something somewhere needs to be
> factored a little better.
> 
> 

  +1.

> Feedback is highly appreciated.
> 
> 

  Best regards,

  Sylvain,

-- 
Sylvain Viollon -- Infrae
t +31 10 243 7051 -- http://infrae.com
Hoevestraat 10 3033GC Rotterdam -- The Netherlands
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20090112/165edf19/attachment.bin 


More information about the Grok-dev mailing list