[Zope] running a External Method via ZEO

Tim Edwards Tim.Edwards at hwe.com.au
Tue Sep 23 00:17:40 EDT 2003


Call me stupid but where does this code go? Your test program?

Thanks

Tim

-----Original Message-----
From: Dieter Maurer [mailto:dieter at handshake.de]
Sent: Saturday, 20 September 2003 5:22 AM
To: Tim Edwards
Cc: 'zope at zope.org'
Subject: RE: [Zope] running a External Method via ZEO


 > 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