[Grok-dev] documentation issue wrt megrok.layout

Souheil CHELFOUH trollfot at gmail.com
Tue Mar 30 08:43:33 EDT 2010


Hello,

The readme of megrok.layout is indeed very synthetic.
The grok_component is declaring in the globals of the testing machinery.
It comes from : grokcore.component.testing

It's not detailed because this process is done at start time by Grok, normally.

2010/3/30 Roger Erens <roger.erens at e-s-c.biz>:
> 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
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
>


More information about the Grok-dev mailing list