/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: mbp at sourcefrog
  • Date: 2011-04-11 01:23:58 UTC
  • mfrom: (5777 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5802.
  • Revision ID: mbp@sourcefrog.net-20110411012358-gl07rdtxydlq7fh1
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
from bzrlib.lazy_import import lazy_import
29
29
lazy_import(globals(), """
30
 
import codecs
31
30
import errno
32
31
import threading
33
 
from warnings import warn
34
32
 
35
33
import bzrlib
36
34
from bzrlib import (
42
40
    osutils,
43
41
    trace,
44
42
    ui,
45
 
    win32utils,
46
43
    )
47
44
""")
48
45
 
49
 
from bzrlib.hooks import HookPoint, Hooks
 
46
from bzrlib.hooks import Hooks
50
47
# Compatibility - Option used to be in commands.
51
48
from bzrlib.option import Option
52
49
from bzrlib.plugin import disable_plugins, load_plugins
788
785
        These are all empty initially, because by default nothing should get
789
786
        notified.
790
787
        """
791
 
        Hooks.__init__(self)
792
 
        self.create_hook(HookPoint('extend_command',
 
788
        Hooks.__init__(self, "bzrlib.commands", "Command.hooks")
 
789
        self.add_hook('extend_command',
793
790
            "Called after creating a command object to allow modifications "
794
791
            "such as adding or removing options, docs etc. Called with the "
795
 
            "new bzrlib.commands.Command object.", (1, 13), None))
796
 
        self.create_hook(HookPoint('get_command',
 
792
            "new bzrlib.commands.Command object.", (1, 13))
 
793
        self.add_hook('get_command',
797
794
            "Called when creating a single command. Called with "
798
795
            "(cmd_or_None, command_name). get_command should either return "
799
796
            "the cmd_or_None parameter, or a replacement Command object that "
800
797
            "should be used for the command. Note that the Command.hooks "
801
798
            "hooks are core infrastructure. Many users will prefer to use "
802
799
            "bzrlib.commands.register_command or plugin_cmds.register_lazy.",
803
 
            (1, 17), None))
804
 
        self.create_hook(HookPoint('get_missing_command',
 
800
            (1, 17))
 
801
        self.add_hook('get_missing_command',
805
802
            "Called when creating a single command if no command could be "
806
803
            "found. Called with (command_name). get_missing_command should "
807
804
            "either return None, or a Command object to be used for the "
808
 
            "command.", (1, 17), None))
809
 
        self.create_hook(HookPoint('list_commands',
 
805
            "command.", (1, 17))
 
806
        self.add_hook('list_commands',
810
807
            "Called when enumerating commands. Called with a set of "
811
808
            "cmd_name strings for all the commands found so far. This set "
812
809
            " is safe to mutate - e.g. to remove a command. "
813
810
            "list_commands should return the updated set of command names.",
814
 
            (1, 17), None))
 
811
            (1, 17))
815
812
 
816
813
Command.hooks = CommandHooks()
817
814