~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/message.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-23 17:00:36 UTC
  • mfrom: (4032.1.4 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090223170036-3q1v68ewdt8i0to5
(Marius Kruger) Remove all trailing whitespace and add tests to
        enforce this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
    def headers_received(self, headers):
38
38
        """Called when message headers are received.
39
 
        
 
39
 
40
40
        This default implementation just stores them in self.headers.
41
41
        """
42
42
        self.headers = headers
67
67
 
68
68
    def protocol_error(self, exception):
69
69
        """Called when there is a protocol decoding error.
70
 
        
 
70
 
71
71
        The default implementation just re-raises the exception.
72
72
        """
73
73
        raise
74
 
    
 
74
 
75
75
    def end_received(self):
76
76
        """Called when the end of the message is received."""
77
77
        # No-op by default.
172
172
 
173
173
    def read_response_tuple(self, expect_body=False):
174
174
        """Reads and returns the response tuple for the current request.
175
 
        
 
175
 
176
176
        :keyword expect_body: a boolean indicating if a body is expected in the
177
177
            response.  Some protocol versions needs this information to know
178
178
            when a response is finished.  If False, read_body_bytes should
292
292
        self.finished_reading = True
293
293
        self._medium_request.finished_reading()
294
294
        raise
295
 
        
 
295
 
296
296
    def read_response_tuple(self, expect_body=False):
297
297
        """Read a response tuple from the wire."""
298
298
        self._wait_for_response_args()
307
307
 
308
308
    def read_body_bytes(self, count=-1):
309
309
        """Read bytes from the body, decoding into a byte stream.
310
 
        
311
 
        We read all bytes at once to ensure we've checked the trailer for 
 
310
 
 
311
        We read all bytes at once to ensure we've checked the trailer for
312
312
        errors, and then feed the buffer back as read_body_bytes is called.
313
313
 
314
314
        Like the builtin file.read in Python, a count of -1 (the default) means