[Grok-doc] Volunteering for a YUI tutorial

Roger Erens roger.erens at e-s-c.biz
Sat Mar 6 15:50:18 EST 2010


Hi Jeroen,

On Fri, Mar 5, 2010 at 16:41, Jeroen Michiel <jmichiel at yahoo.com> wrote:
> I think the turorial is finished.
> Can someone proof read it to check if everything actually works, and if I'm not telling lies, or not using some best practices?
> http://grok.zope.org/documentation/tutorial/using-yui-on-grok


thanks for the effort.
Here's some feedback on the first page of your tutorial:

1) Maybe you can make it work for both Grok1.0 _and_ Grok1.1 (it now
only states to apply to Grok1.0)
2) When you mention the packages that are being used, you might create
links for them referring to Pypi, which saves the interested reader a
few clicks/key presses
3) When you say "see other docs how to do that" it might be nice to
turn that into links to the docs you refer to
4) Typo: "renders you view inside it" should be "renders your view inside it"
5) I would prefer to write out the ids of the div-elements like hd,
bd, and ft as header, body, and footer
6) Typo: "YUI css of js file" should be "YUI css or js file"
7) Typo: "a special one that will add needed resources" should be (?)
"a special one that will add the needed resources"
8) Typo: "add your app and browe to it" should be "add your app and
browse to it"
9) Maybe you can add a screen shot of what to expect when browsing to
the added app
10) Maybe you should indicate that the intended audience should be
knowledgable about "layouts" (and "layers"?). I don't know about them,
and I don't recall them being mentioned in the 'main' tutorial (Quick
Start Guide)
11) For Grok1.0 (created using grokproject --grokversion=1.0), when I
run bin/buildout after having adapted setup.py and buildout.cfg, I get
this error:
(ge)roger at HP-U:~/ge/yt$ bin/buildout
Develop: '/home/roger/ge/yt/.'
Updating eggbasket.
Updating app.
Getting distribution for 'megrok.layout==0.9'.
Got megrok.layout 0.9.
While:
  Updating app.
Error: There is a version conflict.
We already have: zope.component 3.4.0
but megrok.pagetemplate 0.4.1 requires 'zope.component>=3.9.1'.

12) For Grok1.1rc1, I get this error when I try to start the server:
(ge)roger at HP-U:~/ge/yuitut$ bin/paster serve parts/etc/deploy.ini
2010-03-06 21:39:04,626 WARNING [root] Developer mode is enabled: this
is a security risk and should NOT be enabled on production servers.
Developer mode can usually be turned off by setting the `devmode`
option to `off` or by removing it from the instance configuration file
completely.
Traceback (most recent call last):
  File "bin/paster", line 157, in <module>
    paste.script.command.run()
  File "/home/roger/.buildout/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py",
line 84, in run
    invoke(command, command_name, options, args[1:])
  File "/home/roger/.buildout/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py",
line 123, in invoke
    exit_code = runner.run(args)
  File "/home/roger/.buildout/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py",
line 218, in run
    result = self.command()
  File "/home/roger/.buildout/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py",
line 276, in command
    relative_to=base, global_conf=vars)
  File "/home/roger/.buildout/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py",
line 313, in loadapp
    **kw)
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 204, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 225, in loadobj
    return context.create()
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 625, in create
    return self.object_type.invoke(self)
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 188, in invoke
    filtered = context.next_context.create()
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 625, in create
    return self.object_type.invoke(self)
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 110, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/util/fixtypeerror.py",
line 57, in fix_call
    val = callable(*args, **kw)
  File "/home/roger/.buildout/eggs/grokcore.startup-0.4-py2.6.egg/grokcore/startup/startup.py",
line 16, in application_factory
    return zope.app.wsgi.getWSGIApplication(zope_conf)
  File "/home/roger/.buildout/eggs/zope.app.wsgi-3.6.1-py2.6.egg/zope/app/wsgi/__init__.py",
line 158, in getWSGIApplication
    db = config(configfile, schemafile, features)
  File "/home/roger/.buildout/eggs/zope.app.wsgi-3.6.1-py2.6.egg/zope/app/wsgi/__init__.py",
line 147, in config
    appsetup.config(options.site_definition, features=features)
  File "/home/roger/.buildout/eggs/zope.app.appsetup-3.13.0-py2.6.egg/zope/app/appsetup/appsetup.py",
line 111, in config
    context = xmlconfig.file(file, context=context, execute=execute)
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/xmlconfig.py",
line 651, in file
    include(context, name, package)
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/xmlconfig.py",
line 550, in include
    processxmlfile(f, context)
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/xmlconfig.py",
line 382, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.6/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.6/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/xmlconfig.py",
line 361, in endElementNS
    self.context.end()
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/config.py",
line 538, in end
    self.stack.pop().finish()
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/config.py",
line 686, in finish
    actions = self.handler(context, **args)
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/xmlconfig.py",
line 550, in include
    processxmlfile(f, context)
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/xmlconfig.py",
line 382, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.6/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.6/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/xmlconfig.py",
line 361, in endElementNS
    self.context.end()
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/config.py",
line 538, in end
    self.stack.pop().finish()
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/config.py",
line 686, in finish
    actions = self.handler(context, **args)
  File "/home/roger/.buildout/eggs/grokcore.component-1.8-py2.6.egg/grokcore/component/zcml.py",
line 48, in grokDirective
    do_grok(package.__name__, _context)
  File "/home/roger/.buildout/eggs/grokcore.component-1.8-py2.6.egg/grokcore/component/zcml.py",
line 53, in do_grok
    config=config
  File "/home/roger/.buildout/eggs/martian-0.11.1-py2.6.egg/martian/core.py",
line 201, in grok_dotted_name
    grok_package(module_info, grokker, **kw)
  File "/home/roger/.buildout/eggs/martian-0.11.1-py2.6.egg/martian/core.py",
line 206, in grok_package
    grok_package(sub_module_info, grokker, **kw)
  File "/home/roger/.buildout/eggs/martian-0.11.1-py2.6.egg/martian/core.py",
line 204, in grok_package
    grok_module(module_info, grokker, **kw)
  File "/home/roger/.buildout/eggs/martian-0.11.1-py2.6.egg/martian/core.py",
line 209, in grok_module
    grokker.grok(module_info.dotted_name, module_info.getModule(),
  File "/home/roger/.buildout/eggs/martian-0.11.1-py2.6.egg/martian/scan.py",
line 122, in getModule
    self._module = resolve(self.dotted_name)
  File "/home/roger/.buildout/eggs/martian-0.11.1-py2.6.egg/martian/scan.py",
line 195, in resolve
    __import__(used)
  File "/home/roger/ge/yuitut/src/yuitut/app.py", line 6, in <module>
    class Index(layout.Page):
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
"/home/roger/ge/yuitut/parts/etc/site.zcml", line 4.2-4.30
    ZopeXMLConfigurationError: File
"/home/roger/ge/yuitut/src/yuitut/configure.zcml", line 5.2-5.27
    NameError: name 'layout' is not defined




Adding to app.py also these lines:

from megrok import layout
from zope.interface import Interface
from hurry import yui

doesn't help much and results in the this error:
bin/paster serve parts/etc/deploy.ini
2010-03-06 21:46:05,889 WARNING [root] Developer mode is enabled: this
is a security risk and should NOT be enabled on production servers.
Developer mode can usually be turned off by setting the `devmode`
option to `off` or by removing it from the instance configuration file
completely.
Traceback (most recent call last):
  File "bin/paster", line 157, in <module>
    paste.script.command.run()
  File "/home/roger/.buildout/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py",
line 84, in run
    invoke(command, command_name, options, args[1:])
  File "/home/roger/.buildout/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py",
line 123, in invoke
    exit_code = runner.run(args)
  File "/home/roger/.buildout/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py",
line 218, in run
    result = self.command()
  File "/home/roger/.buildout/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py",
line 276, in command
    relative_to=base, global_conf=vars)
  File "/home/roger/.buildout/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py",
line 313, in loadapp
    **kw)
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 204, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 225, in loadobj
    return context.create()
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 625, in create
    return self.object_type.invoke(self)
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 188, in invoke
    filtered = context.next_context.create()
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 625, in create
    return self.object_type.invoke(self)
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
line 110, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/home/roger/.buildout/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/util/fixtypeerror.py",
line 57, in fix_call
    val = callable(*args, **kw)
  File "/home/roger/.buildout/eggs/grokcore.startup-0.4-py2.6.egg/grokcore/startup/startup.py",
line 16, in application_factory
    return zope.app.wsgi.getWSGIApplication(zope_conf)
  File "/home/roger/.buildout/eggs/zope.app.wsgi-3.6.1-py2.6.egg/zope/app/wsgi/__init__.py",
line 158, in getWSGIApplication
    db = config(configfile, schemafile, features)
  File "/home/roger/.buildout/eggs/zope.app.wsgi-3.6.1-py2.6.egg/zope/app/wsgi/__init__.py",
line 147, in config
    appsetup.config(options.site_definition, features=features)
  File "/home/roger/.buildout/eggs/zope.app.appsetup-3.13.0-py2.6.egg/zope/app/appsetup/appsetup.py",
line 111, in config
    context = xmlconfig.file(file, context=context, execute=execute)
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/xmlconfig.py",
line 653, in file
    context.execute_actions()
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/config.py",
line 600, in execute_actions
    for action in resolveConflicts(self.actions):
  File "/home/roger/.buildout/eggs/zope.configuration-3.7.1-py2.6.egg/zope/configuration/config.py",
line 1507, in resolveConflicts
    raise ConfigurationConflictError(conflicts)
zope.configuration.config.ConfigurationConflictError: Conflicting
configuration actions
  For: ('utility', <InterfaceClass
z3c.flashmessage.interfaces.IMessageReceiver>, u'')
    File "/home/roger/.buildout/eggs/grokui.admin-0.3.3-py2.6.egg/grokui/admin/configure.zcml",
line 6.2-6.27
        <grok:grok package="." />
    File "/home/roger/.buildout/eggs/grokcore.message-0.3-py2.6.egg/grokcore/message/configure.zcml",
line 5.2-5.27
        <grok:grok package="." />
  For: ('utility', <InterfaceClass
z3c.flashmessage.interfaces.IMessageSource>, 'session')
    File "/home/roger/.buildout/eggs/grokui.admin-0.3.3-py2.6.egg/grokui/admin/configure.zcml",
line 6.2-6.27
        <grok:grok package="." />
    File "/home/roger/.buildout/eggs/grokcore.message-0.3-py2.6.egg/grokcore/message/configure.zcml",
line 5.2-5.27
        <grok:grok package="." />


I hope some of this makes sense, if you need additional info I'll be
glad to provide so.

Best,

Roger


More information about the grok-doc mailing list