~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/client.py

  • Committer: Robert Collins
  • Date: 2009-03-26 23:16:06 UTC
  • mto: This revision was merged to the branch mainline in revision 4216.
  • Revision ID: robertc@robertcollins.net-20090326231606-rh98suac20x246pk
Review caught a bogus change to test_last_modified_revision_after_commit_link_unchanged_ric.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import bzrlib
18
18
from bzrlib.smart import message, protocol
36
36
        else:
37
37
            self._headers = dict(headers)
38
38
 
39
 
    def __repr__(self):
40
 
        return '%s(%r)' % (self.__class__.__name__, self._medium)
41
 
 
42
39
    def _send_request(self, protocol_version, method, args, body=None,
43
40
                      readv_body=None, body_stream=None):
44
41
        encoder, response_handler = self._construct_protocol(
194
191
class SmartClientHooks(hooks.Hooks):
195
192
 
196
193
    def __init__(self):
197
 
        hooks.Hooks.__init__(self, "bzrlib.smart.client", "_SmartClient.hooks")
198
 
        self.add_hook('call',
 
194
        hooks.Hooks.__init__(self)
 
195
        self.create_hook(hooks.HookPoint('call',
199
196
            "Called when the smart client is submitting a request to the "
200
197
            "smart server. Called with a bzrlib.smart.client.CallHookParams "
201
198
            "object. Streaming request bodies, and responses, are not "
202
 
            "accessible.", None)
 
199
            "accessible.", None, None))
203
200
 
204
201
 
205
202
_SmartClient.hooks = SmartClientHooks()