10.7.1. Class cerebro.gui.AccountDialog

class cerebro.gui.AccountDialog(title, label='', store_key='')[source]
  • title (string) – dialog title.
  • label (string) – text label.
  • store_key (string) – a key to restore previously saved login and password.

Credentials input dialogue class.


daccount = cerebro.gui.account_dialog('Example', 'Enter your login and password', 'store_key')
res = daccount.execute()
if res == True:
        print('Login and password entered by user:', daccount.login(), daccount.password())
        daccount.store('store_key') # saving the password for future calls      
Returns:True, if the user entered login and password and pressed “OK” button or if the login and password were saved earlier.
Return type:bool

Displays a dialog window.

If the login and password were saved during a previous call, the dialog window is not displayed, “True” returns, and then you can resolve the login and password by using the following methods: login() and password().

Returns:login entered by user.
Return type:string

See also


Returns:password entered by user.
Return type:string
Parameters:login (string) – login.

Sets login value.

See also


store(store_key, expires=7)[source]
  • store_key (string) – key for saving login and password.
  • expires (int) – password storage period, days. Setting the argument to -1 means the storage period is unlimited.

The dialog saves login and password by a text key for the desired period of time. To restore a previously saved password, pass the key used for saving to the dialog constructor.


All passwords are stored in encrypted form.