~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: 2013-05-25 00:23:24 UTC
  • mfrom: (6575.1.3 1184021)
  • Revision ID: pqm@pqm.ubuntu.com-20130525002324-a3vwfemjm3vlhspz
(vila) Add __iter__ to http ResponseFile (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    """A wrapper around the http socket containing the result of a GET request.
39
39
 
40
40
    Only read() and seek() (forward) are supported.
 
41
 
41
42
    """
42
43
    def __init__(self, path, infile):
43
44
        """Constructor.
71
72
        self._pos += len(data)
72
73
        return data
73
74
 
 
75
    def __iter__(self):
 
76
        while True:
 
77
            line = self.readline()
 
78
            if not line:
 
79
                return
 
80
            yield line
 
81
 
74
82
    def tell(self):
75
83
        return self._pos
76
84