[Grok-dev] Grok naming issues.

Lennart Regebro regebro at gmail.com
Sun Apr 27 08:08:39 EDT 2008

Godefroid raised an issue that had us thinking here.

If I wrote a simple module for five.grok it could most likely work
under Proper Grok as well. However, because it's called five.grok, it
will fail on the import "from five import grok" where Grok wants just
"import grok". So to have more modules that work under both we could
fix the namespace so that you do "import grok" under five.grok as
well. (We tried that quickly, it did work fine). This would also means
that a module that has say, some sort of global utility written for
grok would work under five.grok.

However, there is a couple of issues with this:

1. plone.grok would either need to have it's plone specific grokkers
under a different namespace (but that would hinder grok simplicity),
or patch its grokkers into the grok namespace, which is ugly.

That can be fixed by making a generic function for registering things
in the grok namespace (possibly using grokkers). Any component in
grokcore.components, five.grok or plone.grok could be registered in
grok namespace.

2. People who want to use Grok under Plone or Zope might add "grok" as
an egg in their buildout, which would install Zope 3 and break

That would be fixed if and when we ship plone.grok with Plone (and
maybe five.grok with Zope 2.12), and that would in that case be a
temporary issue.

Opinions on this? Better solutions? More drawbacks benefits with the
different attitudes?

Lennart Regebro: Zope and Plone consulting.
+33 661 58 14 64

More information about the Grok-dev mailing list