~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-30 11:45:54 UTC
  • mto: (5622.4.1 uninstall-hook)
  • mto: This revision was merged to the branch mainline in revision 5747.
  • Revision ID: jelmer@samba.org-20110330114554-zx7av89umf2dd9an
Don't require arguments to hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
769
769
class CommandHooks(Hooks):
770
770
    """Hooks related to Command object creation/enumeration."""
771
771
 
772
 
    def __init__(self, module_name, member_name):
 
772
    def __init__(self):
773
773
        """Create the default hooks.
774
774
 
775
775
        These are all empty initially, because by default nothing should get
776
776
        notified.
777
777
        """
778
 
        Hooks.__init__(self, module_name, member_name)
 
778
        Hooks.__init__(self, "bzrlib.commands", "Command.hooks")
779
779
        self.add_hook('extend_command',
780
780
            "Called after creating a command object to allow modifications "
781
781
            "such as adding or removing options, docs etc. Called with the "
800
800
            "list_commands should return the updated set of command names.",
801
801
            (1, 17))
802
802
 
803
 
Command.hooks = CommandHooks("bzrlib.commands", "Command.hooks")
 
803
Command.hooks = CommandHooks()
804
804
 
805
805
 
806
806
def parse_args(command, argv, alias_argv=None):