Initializer.
(self)
| 31 | """An app that shows off async_alert() and async_update_prompt().""" |
| 32 | |
| 33 | def __init__(self) -> None: |
| 34 | """Initializer.""" |
| 35 | super().__init__() |
| 36 | |
| 37 | self.prompt = "(APR)> " |
| 38 | |
| 39 | # The thread that will asynchronously alert the user of events |
| 40 | self._stop_event = threading.Event() |
| 41 | self._add_alert_thread = threading.Thread() |
| 42 | self._alert_count = 0 |
| 43 | self._next_alert_time = 0.0 |
| 44 | |
| 45 | # Create some hooks to handle the starting and stopping of our thread |
| 46 | self.register_preloop_hook(self._preloop_hook) |
| 47 | self.register_postloop_hook(self._postloop_hook) |
| 48 | |
| 49 | def _preloop_hook(self) -> None: |
| 50 | """Start the alerter thread.""" |
nothing calls this directly
no test coverage detected