[Zope] Importing External Methods

Thomas B. Passin tpassin@mitretek.org
Fri, 17 May 2002 12:09:56 -0400


[<belen@netcom.no>]
I have two external methods in the same zope folder. Is there a way to
import one of the external methods into the other one? I need to access
a datatype class from one to the other.

[Tom P]

Here's what I recommend.  Use the methods in the Extensions directory only
to invoke the real code, which would live somewhere else (not even in the
Zope directory tree).

Then make your code into a package with as many file as you want, like any
other Python programming project.  You will be able to import anything as
usual, and you will keep the Extensions directory and its files clean and
uncluttered.  With this approach, you can also import any classes or methods
you need into the external method.

I use .pth files to get my code into the python path so Zope can find them.

Cheers,

Tom P