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