38
edits
Changes
From Gramps
→Config: Modified example of config initialisation
Some addons may want to have persistent data (data settings that remain between sessions). You can handle this yourself, or you can use Gramps' built-in configure system.
from config import configas configman cm config = configconfigman.register_manager("view_placetreeview_0grampletname") cm# register the values to save: config.register("section.variable1option-name1", value1) cmconfig.register("section.variable2option-name2", value2)
...
x = cm.get("section.variable1option-name1") cm.set("section.variable1option-name1", 3)
and when this code is exiting, you might want to save the config. In a Gramplet that would be:
from config import config
cm = config.get_manager("view_placetreeview_0grampletname") x = cm.get("section.variable1option-name1")
=== Localization ===