[Zope] Recursively read and write folders during install
Tino Wildenhain
tino at wildenhain.de
Tue Mar 22 06:11:06 EST 2005
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 at wildenhain.de>
More information about the Zope
mailing list