~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/response.py

  • Committer: Patch Queue Manager
  • Date: 2012-04-10 10:26:46 UTC
  • mfrom: (6519.1.2 responsefile-readline)
  • Revision ID: pqm@pqm.ubuntu.com-20120410102646-rv7zpi85e168o1k4
(jelmer) Implement ResponseFile.readline. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        self._pos += len(data)
67
67
        return data
68
68
 
 
69
    def readline(self):
 
70
        data = self._file.readline()
 
71
        self._pos += len(data)
 
72
        return data
 
73
 
 
74
    def tell(self):
 
75
        return self._pos
 
76
 
69
77
    def seek(self, offset, whence=os.SEEK_SET):
70
78
        if whence == os.SEEK_SET:
71
79
            if offset < self._pos:
72
 
                raise AsserttionError(
 
80
                raise AssertionError(
73
81
                    "Can't seek backwards, pos: %s, offset: %s"
74
 
                    % (self._pos, offfset))
 
82
                    % (self._pos, offset))
75
83
            to_discard = offset - self._pos
76
84
        elif whence == os.SEEK_CUR:
77
85
            to_discard = offset