proposal - move bzrlib down a level

Lalo Martins lalo at exoweb.net
Thu Sep 1 11:49:53 BST 2005


And so says Robert Collins on 01/09/05 17:47...
> Putting bzrlib in a lib subdirectory wont make it harder for folk using
> bzr - it will make it easier. (they have to set their PYTHONPATH
> regardless).

Sorry, this time you're wrong :-)  it works rather well for me without
setting PYTHONPATH.

<technical>
...because my "bzr" is a symlink to the source tree -
`ln -s ~/src/bzr.dev/bzr /usr/local/bin` - and then python will check
where the script is, and put the parent directory in the path implicitly.
</technical>

So if you don't want to add inconvenience, you'd have to do some
sys.path mangling by hand.  (Not terribly hard to do, though.)

Demonstration:
lalo:~> cat >~/tmp/test.py <<EOF
#!/usr/bin/python
import sys
print sys.argv[0]
print sys.path
EOF
lalo:~> chmod a+x ~/tmp/test.py
lalo:~> ln -s ~/tmp/test.py /usr/local/bin
lalo:~> test.py
/usr/local/bin/test.py
['/home/lalo/tmp', '/usr/lib/python24.zip', '/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk',
'/usr/lib/python2.4/lib-dynload',
'/usr/local/lib/python2.4/site-packages',
'/usr/lib/python2.4/site-packages',
'/usr/lib/python2.4/site-packages/HTMLgen',
'/usr/lib/python2.4/site-packages/Nevow',
'/usr/lib/python2.4/site-packages/Numeric',
'/usr/lib/python2.4/site-packages/PIL',
'/usr/lib/python2.4/site-packages/gtk-2.0',
'/usr/lib/python2.4/site-packages/wx-2.5.3-gtk2-unicode',
'/usr/lib/site-python']


best,
                                               Lalo Martins
--
      So many of our dreams at first seem impossible,
       then they seem improbable, and then, when we
       summon the will, they soon become inevitable.
--
http://www.exoweb.net/                  mailto:lalo at exoweb.net
GNU: never give up freedom                 http://www.gnu.org/





More information about the bazaar mailing list