TomlkitLoader#
- class TomlkitLoader(app, filename, *args, **kwargs)#
Bases:
FileLoader,DictLikeLoaderMixinLoad config from TOML files using tomlkit library.
The
tomlkitlibrary is the default for neba, as it allows precise creation of toml files (including comments) which is useful for creating fully documented config files.- Parameters:
app (Application)
filename (str)
args (Any)
kwargs (Any)
- load_config()#
Populate the config attribute from TOML file.
- Return type:
- serialize_section(t, section, fullpath, comment='full', comment_default=False)#
Serialize a Section and its subsections recursively.
We allow to write without the subsections initialized. The config attribute will have the instances’ values when possible so we don’t need to access the sections instances here.
We use the extented capabilities of
tomlkit.
- wrap_comment(item, text)#
Wrap text correctly and add it to a toml container as comment lines.