[Zope] probably a faq: access INSTANCE_HOME

Mark McEahern mark@mceahern.com
Fri, 8 Nov 2002 16:05:51 -0600


Admittedly, I spent 5 minutes searching and no joy...

How does one access INSTANCE_HOME in an external method?

The logic I need is something like this--I'm just missing the incantation
for my fanciful getZopeEnviron.

Help?

# a fanciful dream...

import os

def dostuff(self):

    location = self.getZopeEnviron("INSTANCE_HOME", None)
    if not location:
        location = self.getZopeEnviron("SOFTWARE_HOME", None)
    if not location:
        raise PukeOla("What the f---?")
    import_dir = os.path.join(location, "import")
    # Now we're cooking with fire...

Cheers,

// m

-