~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/server.py

  • Committer: Martin Pool
  • Date: 2009-03-13 03:01:14 UTC
  • mfrom: (4138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4144.
  • Revision ID: mbp@sourcefrog.net-20090313030114-y723gefxl8tfynsd
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import sys
22
22
import threading
23
23
 
24
 
from bzrlib.hooks import Hooks
 
24
from bzrlib.hooks import HookPoint, Hooks
25
25
from bzrlib import (
26
26
    errors,
27
27
    trace,
208
208
        notified.
209
209
        """
210
210
        Hooks.__init__(self)
211
 
        # Introduced in 0.16:
212
 
        # invoked whenever the server starts serving a directory.
213
 
        # The api signature is (backing urls, public url).
214
 
        self['server_started'] = []
215
 
        # Introduced in 0.16:
216
 
        # invoked whenever the server stops serving a directory.
217
 
        # The api signature is (backing urls, public url).
218
 
        self['server_stopped'] = []
 
211
        self.create_hook(HookPoint('server_started',
 
212
            "Called by the bzr server when it starts serving a directory. "
 
213
            "server_started is called with (backing urls, public url), "
 
214
            "where backing_url is a list of URLs giving the "
 
215
            "server-specific directory locations, and public_url is the "
 
216
            "public URL for the directory being served.", (0, 16), None))
 
217
        self.create_hook(HookPoint('server_stopped',
 
218
            "Called by the bzr server when it stops serving a directory. "
 
219
            "server_stopped is called with the same parameters as the "
 
220
            "server_started hook: (backing_urls, public_url).", (0, 16), None))
219
221
 
220
222
SmartTCPServer.hooks = SmartServerHooks()
221
223