Skip to content

incendium.vision.gui.authentication

César Román edited this page Apr 30, 2024 · 2 revisions

Description

Open up a popup input dialog box.

This dialog box will show a prompt message, and allow the user to type in their username and password. When the user is done, they can press "OK" or "Cancel". If "OK" is pressed, this function will attempt to validate the User credentials against the Authentication Profile. If "Cancel" is pressed, this function will return False.

Syntax

incendium.vision.gui.authentication([auth_profile], [title], [username_label_text], [password_label_text])

Args:

  • auth_profile (str): The name of the authentication profile to run against. Leaving this out will use the project's default profile. Optional.
  • title (str): A title for the input box. This will be translated to the selected Locale. Optional. Defaults to "Authentication".
  • username_label_text (str): The text to display for the username label. This will be translated to the selected Locale. Optional. Defaults to "Username".
  • password_label_text: The text to display for the password label. This will be translated to the selected Locale. Optional. Defaults to "Password".

Returns:

  • bool: True if the user was validated, False otherwise.

Recommendations

None.

Code Examples

from incendium.vision import gui


def important_task():
    pass


if gui.authentication():
    important_task()
else:
    gui.error("Invalid credentials")
Clone this wiki locally