Package yum :: Module config :: Class BaseConfig
[hide private]
[frames] | no frames]

Class BaseConfig

source code


Base class for storing configuration definitions. Subclass when creating your own definitons.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
str(x)
source code
 
populate(self, parser, section, parent=None)
Set option values from a INI file section.
source code
 
iterkeys(self)
Yield the names of all defined options in the instance.
source code
 
iteritems(self)
Yield (name, value) pairs for every option in the instance.
source code
 
write(self, fileobj, section=None, always=())
Write out the configuration to a file-like object
source code
 
getConfigOption(self, option, default=None) source code
 
setConfigOption(self, option, value) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
optionobj(cls, name, exceptions=True)
Return the Option instance for the given name
 
isoption(cls, name)
Return True if the given name refers to a defined option
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

populate(self, parser, section, parent=None)

source code 

Set option values from a INI file section.

Parameters:
  • parser - ConfParser instance (or subclass)
  • section - INI file section to read use.
  • parent - Optional parent BaseConfig (or subclass) instance to use when doing option value inheritance.

iteritems(self)

source code 

Yield (name, value) pairs for every option in the instance.

The value returned is the parsed, validated option value.

write(self, fileobj, section=None, always=())

source code 

Write out the configuration to a file-like object

Parameters:
  • fileobj - File-like object to write to
  • section - Section name to use. If not-specified the section name used during parsing will be used.
  • always - A sequence of option names to always write out. Options not listed here will only be written out if they are at non-default values. Set to None to dump out all options.