Hello,

WIth Zope2, when I need to create or read a file in the filesystem, I
usually go in /myzopeinstance/var directory
and to find it is pretty easy:
import os
os.environ['CLIENT_HOME']

But in Zope3, CLIENT_HOME or INSTANCE_HOME are no longer provided in
os.environ

I had a look to different source code, and apparently the solution is to use
the path of the current file to get the instance home, so we have code like
this:
os.path.normpath(
            os.path.join(os.path.dirname(__file__),
                         os.pardir, os.pardir, os.pardir, os.pardir))

Is there any easier (and cleaner) way to do it ?

Eric BREHAULT
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to