research_client.utils

Utility functions for the LART Research Client app.

Functions

export_backup([filename])

Export app data as a ZIP archive.

manage_settings(command)

Manage app settings file.

show_error_dialog([title, message])

Display a graphical error message box even if eel is not active.

_recursively_overwrite_attr(obj, attr, value)[source]
Return type:

bool

Parameters:
  • obj (object)

  • attr (str)

  • value (Any)

export_backup(filename=None)[source]

Export app data as a ZIP archive. Prompt for filename if needed.

Return type:

bool

Parameters:

filename (Optional[Union[Path, str]])

manage_settings(command)[source]

Manage app settings file.

Parameters:

command (Union[Literal['update', 'reset', 'clear'], str]) –

One of the operations to be carried out on the settings file, or a JSON string with key-value pairs to be merged into the current settings for the app.

The following commands are available by keyword:
  • update: Load app settings from current file and save them

    again. This is useful if a settings file may not include all the key-value pairs that a user may want to control, for instance after an app update.

  • reset: Reset the settings file to the hard-coded app

    defaults. This is useful in cases where a settings file may have become corrupted and where the user wants to start afresh with manually edit the local settings. Effectively, this is the same as using clear followed by update.

  • clear: Remove the settings file. On the next start-up, the

    app will then use the hard-coded app defaults. This is useful in cases where the user wants to revert to the apps default settings, without the intent to make manual changes.

Return type:

bool

show_error_dialog(title=None, message=None)[source]

Display a graphical error message box even if eel is not active.

Parameters:
  • title (Optional[str])

  • message (Optional[str])