Accessing to ZOPE_HOME
Hi all: How can access to the value of the "ZOPE_HOME" that Control_Panel shows in the Zope Management Interface?. My target is read in execution time a content of one external method, but my zope server can run over windows or linux, and i must refer the folder when the zope are installed, indeed when the external methods are located, for example: "/usr/lib/zope2.7/Extensions" or "C:\Program Files\Zope-2.7.4-0\Extensions" I prove with "os.getcwd()" but the value returned is for example:"/var/lib/zope2.7/instance/..." Thank in advance __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/
Am Sonntag, den 20.03.2005, 12:44 -0800 schrieb leticia larrosa:
Hi all:
How can access to the value of the "ZOPE_HOME" that Control_Panel shows in the Zope Management Interface?. My target is read in execution time a content of one external method, but my zope server can run over windows or linux, and i must refer the folder when the zope are installed, indeed when the external methods are located, for example: "/usr/lib/zope2.7/Extensions" or "C:\Program Files\Zope-2.7.4-0\Extensions" I prove with "os.getcwd()" but the value returned is for example:"/var/lib/zope2.7/instance/..."
Looks like you are really looking for some files in context of your external method. Use something like: os.path.dirname(os.path.abspath(__file__)) in your module containing the external method. HTH Tino
Tino Wildenhain wrote at 2005-3-20 22:05 +0100:
... Looks like you are really looking for some files in context of your external method.
Use something like:
os.path.dirname(os.path.abspath(__file__))
in your module containing the external method.
Note that this works in a normal Python module but not inside an External Method. External Methods are not imported but read. Therefore, they lack the standard module attributes. -- Dieter
leticia larrosa wrote at 2005-3-20 12:44 -0800:
How can access to the value of the "ZOPE_HOME" that Control_Panel shows in the Zope Management Interface?.
"App.FindHomes" puts it in "__builtin__". This means that it is available as a built in in trusted code. You can access it simply via "ZOPE_HOME"... -- Dieter
participants (3)
-
Dieter Maurer -
leticia larrosa -
Tino Wildenhain