Read one line from the pseudoterminal, and return it as unicode. Can block if there is nothing to read. Raises :exc:`EOFError` if the terminal was closed. note: this is a specialized version that does not have \r\n at the end
(self)
| 136 | return self.decoder.decode(b, final=False) |
| 137 | |
| 138 | def readline(self): |
| 139 | """Read one line from the pseudoterminal, and return it as unicode. |
| 140 | |
| 141 | Can block if there is nothing to read. Raises :exc:`EOFError` if the |
| 142 | terminal was closed. |
| 143 | note: this is a specialized version that does not have \r\n at the end |
| 144 | """ |
| 145 | # TODO implement a timeout |
| 146 | b = super(SimplePty, self).readline().strip() |
| 147 | s = self.decoder.decode(b, final=False) |
| 148 | if self.skip_ansi: |
| 149 | s = remove_ansi_escape_sequences(s) |
| 150 | return s |
| 151 | |
| 152 | def write(self, s): |
| 153 | """Write the unicode string ``s`` to the pseudoterminal. |