(self, *data)
| 476 | return result |
| 477 | |
| 478 | def write(self, *data): |
| 479 | if (len(data) == 0) or (len(data) == 1 and data[0] == ""): |
| 480 | return |
| 481 | out = "".join((str(j) for j in data)) |
| 482 | n = 0 |
| 483 | for i in out: |
| 484 | if i == "\n": |
| 485 | n += 1 |
| 486 | if n == len(out): |
| 487 | self.pending_newlines = max(self.pending_newlines, n) |
| 488 | return |
| 489 | elif n: |
| 490 | self.pending_newlines = max(self.pending_newlines, n) |
| 491 | out = out[n:] |
| 492 | break |
| 493 | else: |
| 494 | break |
| 495 | |
| 496 | if self.pending_newlines > 0: |
| 497 | self.f.write("\n" * self.pending_newlines) |
| 498 | self.pending_newlines = 0 |
| 499 | |
| 500 | for i in out[::-1]: |
| 501 | if i == "\n": |
| 502 | self.pending_newlines += 1 |
| 503 | else: |
| 504 | break |
| 505 | |
| 506 | if self.pending_newlines: |
| 507 | out = out[: -self.pending_newlines] |
| 508 | self.f.write(out) |
| 509 | |
| 510 | def println(self, *data): |
| 511 | if data and not (len(data) == 1 and data[0] == ""): |
no test coverage detected