[Grok-dev] Re: Suggestions or advice for how to debug a grok app using PyDev?

Martin Aspeli optilude at gmx.net
Mon Jun 2 17:12:56 EDT 2008

Craeg Strong wrote:
> Thanks for the reply!
> I am glad to hear you got it working, but I am confused by the 
> references to Zope2 below.
> Does that mean you are using Zope 3 and Grok via Five? 

No, I'm developing a Plone project. By the PyDev aspect is the same.

> That might mean you are using Zope's http server rather than Twisted, 
> which means you have a different main class / entry point.
> Is that a correct analysis?

No, but the HTTP server you're using doesn't matter. pydevd works by 
connecting a a local "debug" server. It doesn't matter what you are running.

> Still, I would be interested in your debug setup-- which is the main 
> class?   It appears to me that for eclipse PyDev debugging, the main 
> class has to be an actual python class that is directly visible to 
> eclipse.

Not with pydev and the debug server.

> That is, you cannot pick a script like "zopectl" or "runzope" 
> nor a python class that is not within your source folders, nor a class 
> that is hidden inside a binary egg. 

Indeed - for the "double click the margin" breakpoint thing, this 
doesn't work. I never got it to work with Zope 2 either. When it forks 
the process, pydev loses its debug handle.

> For that reason as well as code completion as you mentioned, you are 
> obliged to add everything to PYTHONPATH (somewhere around 100 source 
> folders and 15 binary eggs I believe-- not a biggie but definitely 
> something to be automated).

Yes, but this is what collective.recipe.omelette does for you.


Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

More information about the Grok-dev mailing list