(self, stdscr, parser)
| 28 | |
| 29 | class NcursesUI: |
| 30 | def __init__(self, stdscr, parser): |
| 31 | self.stdscr = stdscr |
| 32 | self.parser = parser |
| 33 | self.current_tab = 0 |
| 34 | self.current_field = 0 |
| 35 | self.scroll_offset = 0 |
| 36 | self.tabs = [] |
| 37 | self.fields = {} |
| 38 | self.running = False |
| 39 | self.process = None |
| 40 | self.queue = None |
| 41 | |
| 42 | # Initialize colors |
| 43 | curses.start_color() |
| 44 | curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_CYAN) # Header |
| 45 | curses.init_pair(2, curses.COLOR_WHITE, curses.COLOR_BLUE) # Active tab |
| 46 | curses.init_pair(3, curses.COLOR_BLACK, curses.COLOR_WHITE) # Inactive tab |
| 47 | curses.init_pair(4, curses.COLOR_YELLOW, curses.COLOR_BLACK) # Selected field |
| 48 | curses.init_pair(5, curses.COLOR_GREEN, curses.COLOR_BLACK) # Help text |
| 49 | curses.init_pair(6, curses.COLOR_RED, curses.COLOR_BLACK) # Error/Important |
| 50 | curses.init_pair(7, curses.COLOR_CYAN, curses.COLOR_BLACK) # Label |
| 51 | |
| 52 | # Setup curses |
| 53 | curses.curs_set(1) |
| 54 | self.stdscr.keypad(1) |
| 55 | |
| 56 | # Parse option groups |
| 57 | self._parse_options() |
| 58 | |
| 59 | def _parse_options(self): |
| 60 | """Parse command line options into tabs and fields""" |
nothing calls this directly
no test coverage detected