~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/message.py

Remove a bunch of cruft, especially the SmartClientRequestProtocolThree class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
        return self._body.read(count)
195
195
 
196
196
    def read_streamed_body(self):
197
 
        # XXX: this doesn't implement error handling for interrupted streams.
198
197
        while not self.finished_reading:
199
198
            while self._bytes_parts:
200
199
                yield self._bytes_parts.popleft()
207
206
 
208
207
 
209
208
def _translate_error(error_tuple):
210
 
    # XXX: Hmm!  Need state from the request.  Hmm.
 
209
    # Many exceptions need some state from the requestor to be properly
 
210
    # translated (e.g. they need a branch object).  So this only translates a
 
211
    # few errors, and the rest are turned into a generic ErrorFromSmartServer.
211
212
    error_name = error_tuple[0]
212
213
    error_args = error_tuple[1:]
213
214
    if error_name == 'LockContention':
216
217
        raise errors.LockContention(*error_args[:2])
217
218
    else:
218
219
        raise errors.ErrorFromSmartServer(error_tuple)
219