21 Mar
2005
21 Mar
'05
8:12 a.m.
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]) ...and then you can get it from elsewhere like: from Products.MyProduct import my_path cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk