kdb.reprconf module

Generic configuration system using unrepr.

Configuration data may be supplied as a Python dictionary, as a filename, or as an open file object. When you supply a filename or file, Python’s builtin ConfigParser is used (with some extensions).

class kdb.reprconf.Config(file=None, **kwargs)

Bases: dict

A dict-like set of configuration data.

May take a file, filename, or dict.

defaults = {}
environments = {}
reset()

Reset self to default values.

update(config)

Update self from a dict, file or filename.

class kdb.reprconf.Parser(defaults=None, dict_type=<class 'collections.OrderedDict'>, allow_no_value=False)

Bases: ConfigParser.ConfigParser

Sub-class of ConfigParser that keeps the case of options and that raises an exception if the file cannot be read.

as_dict(raw=False, vars=None)

Convert an INI file to a dictionary

dict_from_file(file)
optionxform(optionstr)
read(filenames)
kdb.reprconf.as_dict(config)

Return a dict from ‘config’ whether it is a dict, file, or filename.

This Page