Screens
elva.widgets.screens
Textual
screens for ELVA apps.
Classes:
-
CredentialScreen
–Modal screen providing a form for credential input.
-
ErrorScreen
–Modal screen displaying an exception message.
CredentialScreen(options, body=None, user=None)
Bases: ModalScreen
Modal screen providing a form for credential input.
Parameters:
-
options
(dict[str, Any]
) –mapping of options for the connection provider.
-
body
(None | str
, default:None
) –informational message displayed above the credential form.
-
user
(None | str
, default:None
) –user name.
Methods:
-
compose
–Hook arranging child widgets.
-
update_and_return_credentials
–Save input credentials and return them after closing the screen.
-
on_button_pressed
–Hook called on a button pressed event.
-
key_enter
–Hook called on an enter pressed event.
Attributes:
-
options
(dict
) –Mapping of options for the connection provider.
-
body
(Static
) –Instance of the static widget displaying an informational message.
-
user
(Input
) –Instance of the input widget for the user name.
-
password
(Input
) –Instance of the input widget for the password.
Source code in src/elva/widgets/screens.py
options = options
instance-attribute
Mapping of options for the connection provider.
body = Static(RichText(body, justify='center'), id='body')
instance-attribute
Instance of the static widget displaying an informational message.
user = Input(placeholder='user', id='user')
instance-attribute
Instance of the input widget for the user name.
password = Input(placeholder='password', password=True, id='password')
instance-attribute
Instance of the input widget for the password.
compose()
update_and_return_credentials()
Save input credentials and return them after closing the screen.
This method saves the credentials encoded in a basic authorization header in the options
attribute for usage in the connection provider.
Source code in src/elva/widgets/screens.py
on_button_pressed(event)
Hook called on a button pressed event.
The credentials get updated and the screen closed.
Parameters:
-
event
(Message
) –message object holding information about the button pressed event.
Source code in src/elva/widgets/screens.py
key_enter()
Hook called on an enter pressed event.
The credentials get updated and the screen closed.
ErrorScreen(exc)
Bases: ModalScreen
Modal screen displaying an exception message.
Parameters:
-
exc
(str
) –the exception message to display.
Methods:
-
compose
–Hook arranging child widgets.
-
on_button_pressed
–Hook called on a button pressed event.
Attributes:
Source code in src/elva/widgets/screens.py
exc = exc
instance-attribute
The exception message to display.
compose()
Hook arranging child widgets.
Source code in src/elva/widgets/screens.py
on_button_pressed(event)
Hook called on a button pressed event.
It closes the screen.
Parameters:
-
event
(Message
) –the message object holding information about the button pressed event.