()
| 100 | sys.stdout.flush() |
| 101 | |
| 102 | def repaint(): |
| 103 | frame = SPINNER[int(time.time() * 10) % len(SPINNER)] |
| 104 | w = term_width() |
| 105 | if drawn_rows["n"] > 0: |
| 106 | sys.stdout.write(f"\033[{drawn_rows['n']}A") |
| 107 | sys.stdout.write("\r\033[J") # clear from cursor to end of screen |
| 108 | total = 0 |
| 109 | for i in range(n): |
| 110 | line = render_row(i, frame) |
| 111 | sys.stdout.write(line + "\n") |
| 112 | total += _wrapped_rows(line, w) |
| 113 | drawn_rows["n"] = total |
| 114 | sys.stdout.flush() |
| 115 | |
| 116 | def redraw_loop(): |
| 117 | while not done_event.is_set(): |
no test coverage detected