[Zope] import inside an external method

Courtland Idstrom court@pixar.com
Fri, 27 Sep 2002 10:13:22 -0700


Hi -

I'm dealing with a few external methods that I prefer to keep in 
separate files. There are a few shared routines that I need to import 
from them, but unfortunately I can't find a way to import things in the 
Extensions directory (for example I need to import a few things from a 
files called shared.py). The only way I've successfully gotten this to 
work is by adding the current path to Extensions to sys.path before 
'import shared'. I'd rather not do it this way in case my zope 
installation moves paths/servers, etc.

Notice that the usual __path__ and __file__ properties from python seem 
to be inaccessible, so I can't add it to sys.path in a way that's going 
to work in the future.

Any ideas?

Thanks
-Courtland