Previous topic

Configuration objects

Next topic

The soclib-specific builder actions

This Page

Configuration spool

class soclib_cc.config.spool.ConfigSpool

Root configuration class, the object in the config variable.

This object has a special feature: it implicitely dereferences the defaut configuration when getting an attribute on it. This way, config.toolchain.something is in fact config.<default>.toolchain.something.

__init__(soclib_dir)

Takes the root of the current soclib installation. Parses “built-in.conf” in the current directory as a starting point.

available()

Lists the available configuration types

set_default(name)

Sets the configuration used sor subsequent attribute gettings.

add_desc_parser(parser)

Configuration file API, adds a class name to be imported, capable of parsing metadata files

Parameters:parser – A metadata provider class name string.
addDescPath(path)

Needed by the configuration file API, adds a description path to the default list. Accepts paths relative the soclib’s root or absolute.

Parameters:path – Root path to add to soclib index path
set(key, value)

Sets an attribute, only supports setting attributes already present in class

__getattr__(key)

Attribute getter hack, returns a :py:class`soclib_cc.config.objects.Config` present in the spool by its name, or equivalent attribute in the defaut config.

Special key “type” returns the current default config name.

__setattr__(key, value)

Attribute setter.

Handled cases:
  • Setting default (must be a Config present in __configs)

    -> changes __default_config

  • Setting a config with any key -> to __configs

  • Setting normal attribute