Random ...
June 2018
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Tags ...

python+zope++:: grokking grok
Posted at 28.Sep,2007 22:00  Comments 0 / Trackbacks 0 / Like this post!
Technorati tag(s):

grok, zope3 for the caveman in you! I've tried grok some time back. grok is supposed to ease people into zope 3.

It has been a while, but I think I've finally get the hang of it (some, not all). There are still a few things that escaped me, and I list them out later.

First of, we need to install grok. Installing is easy. Get easyinstall.

Once easyinstall is installed, run:

  easy_install grok             #grok the caveman
  easy_install grokproject   #the script that will help buld grokapp easily

Now, say we want to build a grokapp called nyapp. Run:

  grokproject myapp

Stuff will fly and at the end we'll get a directory called my app with default directories and files.

Now cd to myapp, and run:

  bin/zopectl fg

And watch grok b0rk:

  ZConfig.SchemaResourceError: schema component not found
  Package name: 'zope.app.appsetup'
  File name: 'schema/schema.xml'
  Package path:  ['/home/kdie/buildout-eggs/zope.app.appsetup-3.4.0-py2.4.egg/zope/app/appsetup']

Martijn have more. It seems that egg dependencies may affect grok install.

Here's a workaround, edit myapp/buildout.cfg, and add these lines:

  versions = grok-0.10

  zope.app.securitypolicy = 3.4.0a1
  zope.app.i18n = 3.4.0a1
  zope.app.appsetup = 3.4.0a1
  zope.app.error = 3.4.0a1  
  zope.app.session = 3.4.0a1
  zope.app.applicationcontrol = 3.4_dev_r73715

Now run bin/buildout:

 $ bin/buildout
 Develop: '/home/kdie/projek/tekateki/.'
 Uninstalling data.
 Updating app.
 Generated script '/home/kdie/projek/tekateki/parts/app/runzope'.
 Generated script '/home/kdie/projek/tekateki/parts/app/debugzope'.
 Installing data.
 Updating zopectl.
 Updating test. 
 Generated script '/home/kdie/projek/tekateki/bin/test'.
 [kdie@tokey tekateki]$ bin/zopectl fg
 /home/kdie/projek/tekateki/parts/app/runzope -C  /home/kdie/projek/tekateki/parts/zopectl/zope.conf
/home/kdie/buildout-eggs/zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/fields.py:417:   UserWarning: You did not specify an i18n translation domain for the 'title' field in /home/kdie/projek/tekateki/parts/app/site.zcml
  2007-09-28T22:00:59 INFO root -- HTTP:localhost:8080 Server  started.
        Hostname: localhost
        Port: 8080
  2007-09-28T22:00:59 INFO root Startup time: 9.447 sec real, 4.120  sec CPU

Success at last. Well, now roll up your sleeves and jump in. grok wiki and get the documentation and sme sample grok apps.

Now, my problems with grok/zope3.

I've been living in zope2 world all these while, and we have products that we glue together with dtml, scripts, and pt to make sites.

With grok/zope3, how the heck we do it? I looked at worldcookery code, and it still escapes me. Maybe I need a hammer to the head to get it.

So, I decided to go ahead and build grok, turn it to megrok.five app and use zope2 to glue it all together.

Make sense? I don't know.

Bookmark and Share

Is this entry helpful? Comments/Donate/Click some google ads.  
Trackback is http://myzope.kedai.com.my/blogs/kedai/154/tbping 

Post a comment