22 Mar
2005
22 Mar
'05
11:11 a.m.
Am Montag, den 21.03.2005, 08:12 +0000 schrieb Chris Withers:
robert wrote:
your product can ask zope where it is installed like: product_path = globals()['__builtins__']['INSTANCE_HOME'] + '/Products'
As Dieter pointed out, this can easily be shorted to just INSTANCE_HOME+'/Products', but that doesn't mean it'll be correct ;-)
Your best bet is DirectoryViews, but if you do ever want ot know the file system path of a Product, then put something like the following in the Product's __init__.py:
import os.path my_path = os.path.abspath(os.path.split(__file__)[0])
os.path.dirname(os.path.abspath(__file__)) please ;)
-- Tino Wildenhain <tino@wildenhain.de>