quick search:
 

Zope monitor instead of python interpreter in Emacs python-mode

Submitted by: shapr
Last Edited: 2004-10-14

Category:

Average rating is: 5.0 out of 5 (2 ratings)

Description:
get interactive access to the same python interpreter that's running your Zope instance from inside Emacs' python-mode

Source (Text):
elisp:
(setq py-jpython-command "/home/shae/monitorshell.sh")

shell script:
#! /bin/sh
/usr/bin/python /usr/lib/zope/ZServer/medusa/monitor_client.py localhost 9099

Explanation:
1. make sure your Zope startup args include "-m 9099" meaning "start the monitor server on port 9099

2. save the shell script above, make sure it points to the right file for your installation, make it executable ( chmod u+x monitorshell.sh )

3. put the line of elisp above into your emacs startup files ( or paste it into your *scratch* buffer and hit C-x C-e with the point directly after the last paren there)

4. swap to a python-mode buffer, hit C-c C-t to switch to JPython mode, then C-c ! to get a monitor interpreter. once you've given the superuser password, import Zope to get interactive access to your running Zope instance.

Note: if you use Jython, you probably don't want to do this, since the monitor interpreter shows up instead of Jython.


Comments:

by RoyMathew - 2004-10-14
Nice technique; the medusa port is way cool - avoids having to create multiple ZEO instances, and emacs is the best!


where is this ZServer you speak of.. by simon - 2004-10-14
Zope 2.7.0 tarball includes ZServer/medusa/ containing a bunch of empty directories only. Neither 2.7.1b1 or latest 2.7 trunk include a ZServer directory.