(stdscr)
| 500 | profiler.realtime_stats = realtime_stats |
| 501 | |
| 502 | def curses_wrapper_func(stdscr): |
| 503 | collector.init_curses(stdscr) |
| 504 | try: |
| 505 | profiler.sample(collector, duration_sec, async_aware=async_aware) |
| 506 | # If too few samples were collected, exit cleanly without showing TUI |
| 507 | if collector.successful_samples < MIN_SAMPLES_FOR_TUI: |
| 508 | # Clear screen before exiting to avoid visual artifacts |
| 509 | stdscr.clear() |
| 510 | stdscr.refresh() |
| 511 | return |
| 512 | # Mark as finished and keep the TUI running until user presses 'q' |
| 513 | collector.mark_finished() |
| 514 | # Keep processing input until user quits |
| 515 | while collector.running: |
| 516 | collector._handle_input() |
| 517 | time.sleep(0.05) # Small sleep to avoid busy waiting |
| 518 | finally: |
| 519 | collector.cleanup_curses() |
| 520 | |
| 521 | try: |
| 522 | curses.wrapper(curses_wrapper_func) |
nothing calls this directly
no test coverage detected
searching dependent graphs…