ibid.config – Configuration Files¶
This module handles Ibid’s configuration file and provides helper functions for accessing configuration from sources and plugins.
Helper Functions¶
-
class
ibid.config.Option(name, description, default=None)¶ A unicode string configuration item.
Parameters: - name – The configuration key
- description – A human-readable description for the configuration item.
- default – The default value, if not specified in the configuration file.
If created as an attribute to a
ibid.plugins.Processororibid.source.IbidSourceFactory, it will retrieve the value ofplugins.plugin.name orsources.source.name.This is also the base class for other Options.
Example:
class Secret(Processor): password = Option('password', 'Secret Password', 's3cr3t')
Assuming that processor is in the
secretplugin, the configuration item could be provided as:[plugins] [[secret]] password = blue
-
class
ibid.config.BoolOption(name, description, default=None)¶ A boolean configuration item.
Usage is identical to
Option.
-
class
ibid.config.IntOption(name, description, default=None)¶ A integer configuration item.
Usage is identical to
Option.
-
class
ibid.config.FloatOption(name, description, default=None)¶ A floating-point configuration item.
Usage is identical to
Option.