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
core.config()

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:

core.config().flush()

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

reload()

Reload config from the disk

get(name)

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()

Clear the config

flush()

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