[Grok-dev] Re: Bug on windows

Philipp von Weitershausen philipp at weitershausen.de
Thu Aug 16 07:10:27 EDT 2007


Max M wrote:
> Creating template grokproject
>   Recursing into bootstrap
>     .\GrokTest\bootstrap\bootstrap.py already exists (same content)
>   .\GrokTest\buildout.cfg already exists (same content)
>   .\GrokTest\setup.py already exists (same content)
>   Recursing into src
>     Recursing into +package+
>       .\GrokTest\src\groktest\app.py already exists (same content)
>       Recursing into +module+_templates
>         .\GrokTest\src\groktest\app_templates\index.pt already exists 
> (same cont
> ent)
>       .\GrokTest\src\groktest\README.txt already exists (same content)
>       .\GrokTest\src\groktest\__init__.py already exists (same content)
>       .\GrokTest\src\groktest\configure.zcml already exists (same content)
> Running C:\Python24\python.exe setup.py egg_info
> Generated script 'D:\\zope3\\GrokTest\\bin\\buildout'.
> C:\Python24\python.exe: can't open file 
> 'D:\zope3\GrokTest\bin\buildout': [Errno
>  2] No such file or directory
> Traceback (most recent call last):
>   File "C:\Python24\Scripts\grokproject-script.py", line 7, in ?
>     sys.exit(
>   File 
> "c:\python24\lib\site-packages\grokproject-0.3dev_r73355-py2.4.egg\grokpr
> oject\__init__.py", line 108, in main
>     os.environ) == 0
> AssertionError

You're using a terribly old grokproject version (0.3dev). The error 
you're getting is due to that version's lack of robustness when spawning 
processes to run buildout.

The latest grokproject works on Windows, except that we still use 
zc.zope3recipes which gained Windows support only recently so that it 
hasn't been released yet.

I favour an instance-less, Paste-based approach anyway. There's a branch 
of grokproject that creates a Paste application instead of a traditional 
Zope 3 instance.


Here's what you can do to get there by yourself:

1. Get the latest grokproject and run it. It should run through and dump
    a "bin\zopectl" script (which won't work, that's why we install Paste
    in the next steps).

2. Add a Paste-friendly application factory to your package
    ('src\YOUR_PACKAGE') by downloading application.py from [1] into the
    package.

3. Add the following section to buildout.cfg::

     [paste]
     recipe = zc.recipe.egg
     eggs = YOUR_EGG
            Paste
            PasteScript
            PasteDeploy

   Then make sure the 'paste' section is in the list of installable parts
   in [buildout]:

     parts = app data zopectl test paste

4. Create a top-level 'deploy.ini' file with the following contents::

     [app:main]
     paste.app_factory = YOUR_PACKAGE.application:application_factory
     conf = zope.conf

     [server:main]
     use = egg:Paste#http
     host = 127.0.0.1
     port = 8080

5. Create a top-level 'zope.conf' with the following contents::

      site-definition PATH_TO_DIR/parts/app/site.zcml

      <zodb>
        <filestorage>
          path PATH_TO_DIR/parts/data/Data.fs
        </filestorage>
      </zodb>

      <eventlog>
        <logfile>
          formatter zope.exceptions.log.Formatter
          path STDOUT
        </logfile>
      </eventlog>

6. Run "bin\buildout". You'll then get a new executable, "bin\paster"
    which you can invoke like this::

      bin\paster serve deploy.ini


[1] 
http://svn.zope.org/*checkout*/grokproject/branches/use-zopeproject/grokproject/template/src/%2Bpackage%2B/application.py


-- 
http://worldcookery.com -- Professional Zope documentation and training


More information about the Grok-dev mailing list