MCPcopy
hub / github.com/Textualize/textual / on_timer

Method on_timer

src/textual/message_pump.py:902–920  ·  view source on GitHub ↗
(self, event: events.Timer)

Source from the content-addressed store, hash-verified

900 await invoke(event.callback)
901
902 async def on_timer(self, event: events.Timer) -> None:
903 if not self.app._running:
904 return
905 event.prevent_default()
906 event.stop()
907 if event.callback is not None:
908 try:
909 self.app.screen
910 except Exception:
911 self.log.warning(
912 f"Not invoking timer callback {event.callback!r} because there is no screen."
913 )
914 return
915 try:
916 await invoke(event.callback)
917 except Exception as error:
918 raise CallbackError(
919 f"unable to run callback {event.callback!r}; {error}"
920 )

Callers

nothing calls this directly

Calls 5

invokeFunction · 0.90
CallbackErrorClass · 0.85
prevent_defaultMethod · 0.80
stopMethod · 0.45
warningMethod · 0.45

Tested by

no test coverage detected