~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/hooks.py

  • Committer: Robert Collins
  • Date: 2009-03-27 04:10:25 UTC
  • mfrom: (4208 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4216.
  • Revision ID: robertc@robertcollins.net-20090327041025-rgutx4q03xo4pq6l
Resolve NEWS conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
18
"""Support for plugin hooking logic."""
 
19
from bzrlib import registry
19
20
from bzrlib.lazy_import import lazy_import
20
 
from bzrlib import registry
21
 
from bzrlib.symbol_versioning import deprecated_method, one_five
 
21
from bzrlib.symbol_versioning import deprecated_method
22
22
lazy_import(globals(), """
23
23
import textwrap
24
24
 
132
132
        """
133
133
        return self._callable_names.get(a_callable, "No hook name")
134
134
 
135
 
    @deprecated_method(one_five)
136
 
    def install_hook(self, hook_name, a_callable):
137
 
        """Install a_callable in to the hook hook_name.
138
 
 
139
 
        :param hook_name: A hook name. See the __init__ method of BranchHooks
140
 
            for the complete list of hooks.
141
 
        :param a_callable: The callable to be invoked when the hook triggers.
142
 
            The exact signature will depend on the hook - see the __init__
143
 
            method of BranchHooks for details on each hook.
144
 
        """
145
 
        self.install_named_hook(hook_name, a_callable, None)
146
 
 
147
135
    def install_named_hook(self, hook_name, a_callable, name):
148
136
        """Install a_callable in to the hook hook_name, and label it name.
149
137