Configure the command palette once the DOM is ready.
(self, _: Mount)
| 816 | self.dismiss() |
| 817 | |
| 818 | def _on_mount(self, _: Mount) -> None: |
| 819 | """Configure the command palette once the DOM is ready.""" |
| 820 | |
| 821 | self.app.post_message(CommandPalette.Opened()) |
| 822 | self._calling_screen = self.app.screen_stack[-2] |
| 823 | |
| 824 | match_style = self.get_visual_style("command-palette--highlight", partial=True) |
| 825 | |
| 826 | assert self._calling_screen is not None |
| 827 | self._providers = [ |
| 828 | provider_class(self._calling_screen, match_style) |
| 829 | for provider_class in self._provider_classes |
| 830 | ] |
| 831 | for provider in self._providers: |
| 832 | provider._post_init() |
| 833 | self._gather_commands("") |
| 834 | |
| 835 | async def _on_unmount(self) -> None: # type: ignore[override] |
| 836 | """Shutdown providers when command palette is closed.""" |
nothing calls this directly
no test coverage detected