Skip to content. | Skip to navigation

Sections
Personal tools

Use IPython as a Shell for Zope

Sure, you can use 'zopectl debug' but IPython runs circles around it ;-) This shell script let's you do just that. All it requires is $PYTHON_PATH pointing to your Zope's SOFTWARE_HOME.

ipython-zope.sh — text/x-sh, 0Kb

File contents

#!/bin/bash
# written 2006-10-09 by Tom Lazar <tom@tomster.org> / http://tomster.org
# by shamelessly stealing from a script[1] by Micheal Thornhill
# [1] http://michaelthornhill.blogspot.com/2005/08/team-development-with-plone-zope-zeo.html
# 
ZOPE_HOME=$1
if [ -z $ZOPE_HOME ] 
    then echo "usage: ipython-zope.sh <PATH-TO-ZOPE_HOME>"
    exit ;
fi
PYTHON=`which python`
set -x
$PYTHON -i -c "from Zope2 import configure;configure('$ZOPE_HOME/etc/zope.conf');import Zope2; app=Zope2.app();ns={'__name__':'blah','app':app};import IPython;IPython.Shell.IPShell(user_ns=ns).mainloop(sys_exit=1);"
Outdated Information
Please note that most of the information contained in this section is several years old and while most of it is still useful, hardly none of it applies directly to current versions of the software discussed. Proceed with caution, your mileage may vary etc. pp. ;-)