PyFoam.Infrastructure.Configuration module

Reads configuration-files that define defaults for various PyFoam-Settings

Also hardcodes defaults for the settings

class PyFoam.Infrastructure.Configuration.Configuration[source]

Bases: configparser.ConfigParser

Reads the settings from files (if existing). Otherwise uses hardcoded defaults

addFile(filename, silent=False)[source]

Add another file to the configuration (if it exists)

bestSection(section, option)[source]

Get the best-fitting section that has that option

configFiles()[source]

Return a list with the configurationfiles that are going to be used

configSearchPath()[source]

Defines a search path for the configuration files as a pare of type/name pairs

dump()[source]

Dumps the contents in INI-Form :return: a string with the contents

get(section, option, default=None, **kwargs)[source]

Overrides the original implementation from ConfigParser :param section: the section :param option: the option :param default: if set and the option is not found, then this value is used

getArch(section, option)[source]

Get an entry. If an entry with <option>_<archname> exists then this is used instead of the plain <option>-entry :param section: the section :param option: the option

getList(section, option, default='', splitchar=', ', stripQuotes=True)[source]

Get a list of strings (in the original they are separated by commas) :param section: the section :param option: the option :param default: if set and the option is not found, then this value is used :param splitchar: the character by which the values are separated :param stripQuotes: remove quotes if present

getRegexp(section, option)[source]

Get an entry and interpret it as a regular expression. Subsitute the usual regular expression value for floating point numbers :param section: the section :param option: the option :param default: if set and the option is not found, then this value is used

getboolean(section, option, default=None)[source]

Overrides the original implementation from ConfigParser :param section: the section :param option: the option :param default: if set and the option is not found, then this value is used

getchoice(section, option, choices, default=None)[source]

Overrides the original implementation from ConfigParser :param section: the section :param option: the option :param choices: list of valid values :param default: if set and the option is not found, then this value is used

getdebug(name)[source]

Gets a debug switch

getfloat(section, option, default=None)[source]

Overrides the original implementation from ConfigParser :param section: the section :param option: the option :param default: if set and the option is not found, then this value is used

getint(section, option, default=None)[source]

Overrides the original implementation from ConfigParser :param section: the section :param option: the option :param default: if set and the option is not found, then this value is used

sectionProxy(section)[source]

Return a proxy object that makes it possible to avoid the section specification

class PyFoam.Infrastructure.Configuration.ConfigurationSectionProxy(conf, section)[source]

Bases: object

Wraps a Confguration so that the section automatically becomes the first argument