Tools for easy persistance of configuration and user preferences for tools.
Configurations are split into sections and keys; sections are conceptually for each tool (or other grouping of settings), and keys are for individual settings within that tool/section. In the current implementation, individual sections are saved within YAML files as a mapping.
Basic usage:
# Creating the config object; give it a unique name. Slashes will be
# used directly to specify sub-directories.
config = metatools.config.Config('your_company/' + __name__)
# Use a value within the config; treat it like a dict.
dialog = setup_gui(width=config.get('width', 800))
# Save the values later.
config['width'] = dialog.width()
config.save() # Only if there were changes to the values.
Quick use:
width = metatools.config.get('your_company/' + __name__, 'width')
metatools.config.set('your_company/' + __name__, 'width', width)