[Zope] running a External Method via ZEO

Dieter Maurer dieter at handshake.de
Fri Sep 19 15:22:10 EDT 2003


 > From: alan runyan [mailto:runyaga at runyaga.com]
 > ...
 > I have a External Method.  A pre-populate Data.fs.
 > I merely want to execute this external method.
 > But the problem is I can not get the INSTANCE_HOME
 > and SOFTWARE_HOME "Products" folders to import into
 > the same namespace.

I use the following hack to work around the well known
"testrunner.py" bug:

#######################################################################
# Hack to find our "INSTANCE_HOME" infrastructure.
# Note, that "testrunner.py" overrides "INSTANCE_HOME". Therefore,
# we look also for "TEST_INSTANCE_HOME"
from os import environ, path
import sys

def _updatePath(path,dir):
  if dir not in path: path.insert(0,dir)

_ih= environ.get('TEST_INSTANCE_HOME') or environ.get('INSTANCE_HOME')
if _ih:
  _updatePath(sys.path, path.join(_ih,'lib','python'))
  import Products; _updatePath(Products.__path__,path.join(_ih,'Products'))




Dieter



More information about the Zope mailing list