Saw this a few weeks ago and wondered if it would be easy to debug zope with pydev.... it is... (you need the Pydev Extensions (which you have to pay for))
- Add path to pydev debug src to your runzope file e.g.
#! /bin/sh PYTHON="/path/to/zopes/python/bin/python" ZOPE_HOME="/path/to/zope-2.9.4-final" INSTANCE_HOME="/path/to/your/zopeinstance" CONFIG_FILE="/path/to/your/zopeinstance/etc/zope.conf" SOFTWARE_HOME="/path/to/zope-2.9.4-final/lib/python" PYTHONPATH="$SOFTWARE_HOME":/path/to/eclipse3.2/plugins/org.python.pydev.debug_1.2.4/pysrc export PYTHONPATH INSTANCE_HOME SOFTWARE_HOME ZOPE_RUN="$SOFTWARE_HOME/Zope2/Startup/run.py" exec "$PYTHON" "$ZOPE_RUN" -C "$CONFIG_FILE" "$@"
- put a breakpoint in your code where you want to stop and inspect by adding the following line to your code
import pydevd; pydevd.settrace()
- start zope
- start the pydev debug server in eclipse Click "Pydev Debug", "Start Debug Server"
- Switch to pydev debug perspective Click "Window", "Open Perspective", "Other", "Debug"
- With your webbrowser click on the link that exercises the function where you placed your breakpoint.
- You should now be able to debug, step through your code and inspect variables in eclipse.
- Happy days!