[Grok-dev] Re: can we really do grokcore.component?

Martijn Faassen faassen at startifact.com
Tue Mar 18 11:22:05 EDT 2008


Brandon Craig Rhodes wrote:
[snip]
> Give me your ideas, even quick ones, so that I can use the remaining
> time of the sprint as best as possible.  Thanks!

Let's forgo any magic for the time being.

I'd propose the following:

* move the relevant directives into grokcore.component.directives

* import them from grok so the grok.* directives work

Normally, a direct directive usage like is the way to go, I think:

grokcore.component.provides()

If you want the convenience of being able to use 'grok.foo' in code that 
uses grokcore.component, you *could* do 'import grokcore.component as grok'.

You could also come up with a special module 'grokd' or something to 
place the directives in:

from grokcore.component import grokd

and then:

grokd.provides()

If you write a module that's only supposed to work with 
grokcore.component, there should be no reason whatsoever to ever port it 
to Grok: you'd use the grokcore.component directives. The other 
direction might happen: someone who writes something against Grok 
realizes it (or parts of it) could just depend on grokcore.component, 
and they'd modify where they import the directives from.

Regards,

Martijn








More information about the Grok-dev mailing list