json — Utility functions for loading and saving JSON

Enki uses JSON for storing settings.

This module is a wrapper around standard json module, which catches and shows exceptions when loading and saving JSON files

enki.core.json_wrapper.load(filePath, dataName, defaultValue)

Try to load data from JSON file. If something goes wrong - shows warnings to user. But, not if file not exists. dataName used in error messages. i.e. ‘cursor positions’, ‘file browser settings’ defaultValue is returned, if file not exists or if failed to load and parse it

enki.core.json_wrapper.dump(filePath, dataName, data, showWarnings=True)

Try to save data to JSON file. Show exceptions on main window and print it, if something goes wrong