Module Config
[hide private]
[frames] | no frames]

Module Config

source code

Classes [hide private]
  Option
A prototype configuration key.
  Config
A configuration registry.
Functions [hide private]
 
define(section, option, type, default='', text='', options='', prototype={'audio': {'bits': <Config.Option instance at 0xa8ebfec>, 'buf...)
Define a configuration key.
source code
 
load(fileName='', setAsDefault=True)
Load a configuration with the default prototype
source code
 
get(section, option)
Read the value of a global configuration key.
source code
 
set(section, option, value)
Write the value of a global configuration key.
source code
Variables [hide private]
  encoding = 'iso-8859-1'
  config = ''
  prototype = {'audio': {'bits': <Config.Option instance at 0xa8...
Function Details [hide private]

define(section, option, type, default='', text='', options='', prototype={'audio': {'bits': <Config.Option instance at 0xa8ebfec>, 'buf...)

source code 
Define a configuration key.
Parameters:
  • section - Section name
  • option - Option name
  • type - Key type (e.g. str, int, ...)
  • default - Default value for the key
  • text - Text description for the key
  • options - Either a mapping of values to text descriptions (e.g. {True: 'Yes', False: 'No'}) or a list of possible values
  • prototype - Configuration prototype mapping

get(section, option)

source code 
Read the value of a global configuration key.
Parameters:
  • section - Section name
  • option - Option name
Returns:
Key value

set(section, option, value)

source code 
Write the value of a global configuration key.
Parameters:
  • section - Section name
  • option - Option name
  • value - New key value

Variables Details [hide private]

prototype

Value:
{}