Run the CLI: See the doc of base_ui.BaseUI.run_ui for more details.
(self,
init_command=None,
title=None,
title_color=None,
enable_mouse_on_start=True)
| 485 | pass |
| 486 | |
| 487 | def run_ui(self, |
| 488 | init_command=None, |
| 489 | title=None, |
| 490 | title_color=None, |
| 491 | enable_mouse_on_start=True): |
| 492 | """Run the CLI: See the doc of base_ui.BaseUI.run_ui for more details.""" |
| 493 | |
| 494 | # Only one instance of the Curses UI can be running at a time, since |
| 495 | # otherwise they would try to both read from the same keystrokes, and write |
| 496 | # to the same screen. |
| 497 | self._single_instance_lock.acquire() |
| 498 | |
| 499 | self._screen_launch(enable_mouse_on_start=enable_mouse_on_start) |
| 500 | |
| 501 | # Optional initial command. |
| 502 | if init_command is not None: |
| 503 | self._dispatch_command(init_command) |
| 504 | |
| 505 | if title is not None: |
| 506 | self._title(title, title_color=title_color) |
| 507 | |
| 508 | # CLI main loop. |
| 509 | exit_token = self._ui_loop() |
| 510 | |
| 511 | if self._on_ui_exit: |
| 512 | self._on_ui_exit() |
| 513 | |
| 514 | self._screen_terminate() |
| 515 | |
| 516 | self._single_instance_lock.release() |
| 517 | |
| 518 | return exit_token |
| 519 | |
| 520 | def get_help(self): |
| 521 | return self._command_handler_registry.get_help() |
nothing calls this directly
no test coverage detected