~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/en/user-guide/writing_a_plugin.txt

  • Committer: John Arbash Meinel
  • Author(s): Mark Hammond
  • Date: 2008-09-09 17:02:21 UTC
  • mto: This revision was merged to the branch mainline in revision 3697.
  • Revision ID: john@arbash-meinel.com-20080909170221-svim3jw2mrz0amp3
An updated transparent icon for bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
``bzrlib.commands.register_command(cmd_foo)``.  You must register the
23
23
command when your file is imported, otherwise bzr will not see it.
24
24
 
25
 
Installing a hook
26
 
-----------------
27
 
 
28
 
See `Using hooks`_.
29
 
 
30
 
 .. _Using hooks: hooks.txt
31
 
 
32
 
 
33
 
Specifying a plugin version number
34
 
----------------------------------
35
 
Simply define ``version_info`` to be a tuple defining the current version
36
 
number of your plugin. eg.
37
 
``version_info = (0, 9, 0)``
38
 
``version_info = (0, 9, 0, 'dev', 0)``
39
 
 
40
25
Plugin searching rules
41
26
----------------------
42
27
 
43
 
Bzr will scan ``~/.bazaar/plugins``  and ``bzrlib/plugins`` for plugins
44
 
by default.  You can override this with  ``BZR_PLUGIN_PATH``
45
 
(see `User Reference 
46
 
<../user-reference/configuration-help.html#bzr-plugin-path>`_ for details).
47
 
 
48
 
Plugins may be either modules or packages.  If your plugin is a single
49
 
file, you can structure it as a module.  If it has multiple files, or if
50
 
you want to distribute it as a bzr branch, you should structure it as a
 
28
Bzr will scan ``bzrlib/plugins`` and ``~/.bazaar/plugins`` for plugins
 
29
by default.  You can override this with ``BZR_PLUGIN_PATH``.  Plugins
 
30
may be either modules or packages.  If your plugin is a single file,
 
31
you can structure it as a module.  If it has multiple files, or if you
 
32
want to distribute it as a bzr branch, you should structure it as a
51
33
package, i.e. a directory with an ``__init__.py`` file.
52
34
 
53
35
More information