read a line from the file
(self)
| 76 | return x |
| 77 | |
| 78 | def readline(self): |
| 79 | """read a line from the file""" |
| 80 | |
| 81 | # Can we get it out of the buffer_file? |
| 82 | s = self.buffer_file.readline() |
| 83 | if s[-1:] == "\n": |
| 84 | return s |
| 85 | # No, so now we read a line from the input file |
| 86 | t = self.file.readline() |
| 87 | |
| 88 | # Append the new data to the buffer, if still buffering |
| 89 | if self._use_buffer: |
| 90 | self.buffer_file.write(t) |
| 91 | |
| 92 | self._check_no_buffer() |
| 93 | |
| 94 | return s + t |
| 95 | |
| 96 | def readlines(self): |
| 97 | """read all remaining lines from the file""" |
no test coverage detected