research_assistant.utils
Utility functions for the LART Research Assistant app.
Functions
|
Export app data as a ZIP archive. |
|
Manage app settings file. |
|
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 (Path | str | None)
- 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 themagain. 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 appdefaults. 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
clearfollowed byupdate.
clear: Remove the settings file. On the next start-up, theapp 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