~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/server.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import sys
23
23
import threading
24
24
 
25
 
from bzrlib.hooks import HookPoint, Hooks
 
25
from bzrlib.hooks import Hooks
26
26
from bzrlib import (
27
27
    errors,
28
28
    trace,
239
239
        These are all empty initially, because by default nothing should get
240
240
        notified.
241
241
        """
242
 
        Hooks.__init__(self)
243
 
        self.create_hook(HookPoint('server_started',
 
242
        Hooks.__init__(self, "bzrlib.smart.server", "SmartTCPServer.hooks")
 
243
        self.add_hook('server_started',
244
244
            "Called by the bzr server when it starts serving a directory. "
245
245
            "server_started is called with (backing urls, public url), "
246
246
            "where backing_url is a list of URLs giving the "
247
247
            "server-specific directory locations, and public_url is the "
248
 
            "public URL for the directory being served.", (0, 16), None))
249
 
        self.create_hook(HookPoint('server_started_ex',
 
248
            "public URL for the directory being served.", (0, 16))
 
249
        self.add_hook('server_started_ex',
250
250
            "Called by the bzr server when it starts serving a directory. "
251
251
            "server_started is called with (backing_urls, server_obj).",
252
 
            (1, 17), None))
253
 
        self.create_hook(HookPoint('server_stopped',
 
252
            (1, 17))
 
253
        self.add_hook('server_stopped',
254
254
            "Called by the bzr server when it stops serving a directory. "
255
255
            "server_stopped is called with the same parameters as the "
256
 
            "server_started hook: (backing_urls, public_url).", (0, 16), None))
 
256
            "server_started hook: (backing_urls, public_url).", (0, 16))
257
257
 
258
258
SmartTCPServer.hooks = SmartServerHooks()
259
259