[MERGE] [1.0] Move material out of User Guide into User Reference
Vincent Ladeuil
v.ladeuil+lp at free.fr
Fri Dec 7 06:45:06 GMT 2007
>>>>> "Ian" == Ian Clatworthy <ian.clatworthy at internode.on.net> writes:
<snip/>
Ian> Note: Can anyone tell me how to find where Bazaar is installed from
Ian> Python? I need that to fix the lookup of the files. It currently only
Ian> works if you run it from that directory - OK for the Makefile but not
Ian> for general users.
I did it that way recently in bzrlib/tests/ssl_certs/__init__.py
(in my https test server branch):
,----
| """ssl_certs -- provides access to ssl keys and certificates needed by tests"""
|
| from bzrlib import (
| osutils,
| )
|
| # Directory containing all ssl files, keys or certificates
| base_dir = osutils.dirname(osutils.realpath(__file__))
|
| def build_path(name):
| """Build and return a path in ssl_certs directory for name"""
| return osutils.pathjoin(base_dir, name)
`----
i.e. use the __file__ of the module itself, being aware that it may be relative.
Vincent
More information about the bazaar
mailing list