(self, buf)
| 90 | return getattr(self.terminal, attr) |
| 91 | |
| 92 | def write(self, buf): |
| 93 | temp_linebuf = self.linebuf + buf |
| 94 | self.linebuf = "" |
| 95 | for line in temp_linebuf.splitlines(True): |
| 96 | # From the io.TextIOWrapper docs: |
| 97 | # On output, if newline is None, any '\n' characters written |
| 98 | # are translated to the system default line separator. |
| 99 | # By default sys.stdout.write() expects '\n' newlines and then |
| 100 | # translates them so this is still cross platform. |
| 101 | if line[-1] == "\n": |
| 102 | encoded_message = line.encode("utf-8", "ignore").decode("utf-8") |
| 103 | self.logger.log(self.log_level, encoded_message.rstrip()) |
| 104 | else: |
| 105 | self.linebuf += line |
| 106 | |
| 107 | def flush(self): |
| 108 | if self.linebuf != "": |
no test coverage detected