default plugin path

Robert Collins robertc at robertcollins.net
Tue Jan 27 02:27:06 GMT 2009


On Mon, 2009-01-26 at 20:50 -0500, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> > recently the bzrlib plugin path for bzrlib users got changed. It used to
> > be set by importing bzrlib, now it isn't (but this does /not/ remove the
> > plugin path - it just sets it to [sys.modules['bzrlib'].__path__[0] +
> > '/plugins']
> > 
> > I'd like to reinstate setting the path at library import time - this
> > won't cause plugins to be loaded, but it will set the path correctly.
> > 
> > Any objections?
> 
> I object.  I don't think that is the right setting.  I don't think there
> *is* a right setting that applies to all bzrlib clients.  Explicit
> better than implicit.  Resist the temptation to guess.

I've never needed to alter the path. And any client that wants a
specific path *can* alter it.

> I don't think clients should have to undo these settings.  I don't see a
> need for this change, since you get the default path anyway if you call
> load_plugins.

I don't want to call load_plugins. I want to 'import
bzrlib.plugins.FOO'.

That used to be - for a *long* time, so clearly not breaking bzrlib
clients::
import bzrlib.plugins.FOO

now it is
import bzrlib.plugin
bzrlib.plugin.set_plugins_path()
import bzrlib.plugins.FOO

which is a dead chicken.

What harmful effect will setting the path have?

-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090127/a8e90bed/attachment-0001.pgp 


More information about the bazaar mailing list