Register a function to be called at the beginning of the command loop.
(self, func: Callable[[], None])
| 5829 | raise TypeError(f"{func.__name__} must have a return type of 'None', got: {ret_ann}") |
| 5830 | |
| 5831 | def register_preloop_hook(self, func: Callable[[], None]) -> None: |
| 5832 | """Register a function to be called at the beginning of the command loop.""" |
| 5833 | self._validate_prepostloop_callable(func) |
| 5834 | self._preloop_hooks.append(func) |
| 5835 | |
| 5836 | def register_postloop_hook(self, func: Callable[[], None]) -> None: |
| 5837 | """Register a function to be called at the end of the command loop.""" |