[Grok-dev] documentation issue wrt megrok.layout

Roger Erens roger.erens at e-s-c.biz
Tue Mar 30 07:37:00 EDT 2010


Hi,

in a Grokv1.0 project I start up bin/python-console and execute the
commands as found on
http://pypi.python.org/pypi/megrok.layout:

   >>> from megrok.layout import Layout
   >>> from zope.interface import Interface
   >>> import grokcore.component as grok
   >>> class MyLayout(Layout):
   ...     grok.name('mylayout')
   ...     grok.context(Interface)
   ...
   ...     def render(self):
   ...         return u"a simple layout"

We grok our component:

   >>> grok_component('MyLayout', MyLayout)
   True

But I don't get True as a result but:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
NameError: name 'grok_component' is not defined

I'm still too much of a newbie to know what 'grokking our component'
is supposed to do, therefore:

what should be used instead of :func:`grok_component()`? Or do I need
to import something else, too?

Cheers,

Roger


More information about the Grok-dev mailing list