config — Load and save settings

class enki.core.config.Config(enableWriting, filePath)

Settings storage.

This class stores core settings. Plugins are also allowed to store its settings here.

Instance is accessible as:

from enki.core.core import core

Created by enki.core.core.Core

Use this object as a dictionary for read and write options. Example:

font = core.config()["Qutepart"]["DefaultFont"]  # read option
core.config()["Qutepart"]["DefaultFont"] = font  # write option

See also get() and set() methods

You SHOULD flush config, when writing changed settings is finished. Example:


Usually flushing is done by enki.core.uisettings.UISettingsManager


Reload config from the disk


Get option by slash-separated path. i.e.

font = core.config().get("Editor/DefaultFont")

Raises KeyError if not found

set(name, value)

Set option by slash-separated path. i.e.

core.config().get("Editor/DefaultFont") = font

Clear the config


Flush config to the disk. Does nothing, if enableWriting is False (probably default config is opened)