#!/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);"
