We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
active_message_pump.get()
LookupError
It seems that active_message_pump.get, when called inside an event handler or action, results in a LookupError exception. For example:
active_message_pump.get
from textual.app import App, ComposeResult from textual.binding import Binding from textual.containers import Center from textual.widgets import Header, Footer, Button, Label from textual._context import active_message_pump class MsgPumpApp( App[ None ] ): CSS = """ Screen { align: center middle; } """ BINDINGS = [ Binding( "space", "show_pump", "Show Message Pump Within Action" ), ] def compose( self ) -> ComposeResult: yield Header() yield Center( Button( "Show Message Pump Within Message" ) ) yield Center( Label( "Active Message Pump Will Be Reported Here" ) ) yield Footer() def on_button_pressed( self ) -> None: self.query_one( Label ).update( f"{active_message_pump.get()!r}") def action_show_pump( self ) -> None: self.query_one( Label ).update( f"{active_message_pump.get()!r}") if __name__ == "__main__": MsgPumpApp().run()
If the button is pressed, or Space is pressed, results in the likes of:
LookupError: <ContextVar name='active_message_pump' at 0x105089080>
The text was updated successfully, but these errors were encountered:
✨ Tester for Textualize/textual#2301
cd6ca8d
Ensure the active message pump is set when app is the sender
41c4273
See Textualize#2301
Ensure the active message pump is set when app is the sender (#2302)
f8b51ea
See #2301
Don't forget to star the repository!
Follow @textualizeio for Textual updates.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
It seems that
active_message_pump.get
, when called inside an event handler or action, results in aLookupError
exception. For example:If the button is pressed, or Space is pressed, results in the likes of:
The text was updated successfully, but these errors were encountered: