Plugin naming

Russel Winder russel.winder at concertant.com
Sun Jun 29 07:53:08 BST 2008


The context here is using Bazaar to download branches of plugins to
~/.bazaar/plugins on Ubuntu.  The example I am using is bzr-rebase.

If I branch a bzr-rebase branch as bzr-rebase then on next use of
Bazaar, you get error message:

Unable to load 'bzr-rebase' in '/home/users/russel/.bazaar/plugins' as a
plugin because the file path isn't a valid module name; try renaming it
to 'rebase'.

OK, I know the reason, - is not a valid in an identifier in Python.
This raises the whole question of using - in the name of the plugins.

If I then move the branch directory to bzr_rebase then I get:

 Two plugins defined the same command: 'cmd_replay'
Not loading the one in <module 'bzrlib.plugins.rebase' from
'/usr/lib/python2.5/site-packages/bzrlib/plugins/rebase/__init__.pyc'>
Previously this command was registered from <module
'bzrlib.plugins.bzr_rebase' from
'/home/users/russel/.bazaar/plugins/bzr_rebase/__init__.pyc'>
Two plugins defined the same command: 'cmd_rebase'
Not loading the one in <module 'bzrlib.plugins.rebase' from
'/usr/lib/python2.5/site-packages/bzrlib/plugins/rebase/__init__.pyc'>
Previously this command was registered from <module
'bzrlib.plugins.bzr_rebase' from
'/home/users/russel/.bazaar/plugins/bzr_rebase/__init__.pyc'>
Two plugins defined the same command: 'cmd_rebase_abort'
Not loading the one in <module 'bzrlib.plugins.rebase' from
'/usr/lib/python2.5/site-packages/bzrlib/plugins/rebase/__init__.pyc'>
Previously this command was registered from <module
'bzrlib.plugins.bzr_rebase' from
'/home/users/russel/.bazaar/plugins/bzr_rebase/__init__.pyc'>
Two plugins defined the same command: 'cmd_rebase_continue'
Not loading the one in <module 'bzrlib.plugins.rebase' from
'/usr/lib/python2.5/site-packages/bzrlib/plugins/rebase/__init__.pyc'>
Previously this command was registered from <module
'bzrlib.plugins.bzr_rebase' from
'/home/users/russel/.bazaar/plugins/bzr_rebase/__init__.pyc'>
Two plugins defined the same command: 'cmd_rebase_todo'
Not loading the one in <module 'bzrlib.plugins.rebase' from
'/usr/lib/python2.5/site-packages/bzrlib/plugins/rebase/__init__.pyc'>
Previously this command was registered from <module
'bzrlib.plugins.bzr_rebase' from
'/home/users/russel/.bazaar/plugins/bzr_rebase/__init__.pyc'>

which is clearly very bad indeed.  It indicates that the name of the
plugin is really going to have to obey some rules, and yet the name that
a branch branches to by default is a free variable.  Clearly there are
constraints on naming, which means that there need to be enforced rules
as to what names can and cannot be used for plugins.

Moving the directory then to rebase means everything appears to work
fine.  Well except that the name o fhte plugin and the name of the
directory in which the plugin resides are not the same which is very
irritating.

-- 
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080629/d9337dc2/attachment.pgp 


More information about the bazaar mailing list