[Zope] probably a faq: access INSTANCE_HOME
Charlie Reiman
creiman@kefta.com
Fri, 8 Nov 2002 14:20:49 -0800
It's just an enviornment variable, so I assume:
import os
os.getenv('INSTANCE_HOME')
should work for an external method.
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Mark
> McEahern
> Sent: Friday, November 08, 2002 2:06 PM
> To: Zope Mailing List
> Subject: [Zope] probably a faq: access INSTANCE_HOME
>
>
> 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
>
> ->