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

Module Config

Classes
Config A configuration registry.
Option A prototype configuration key.

Function Summary
  define(section, option, type, default, text, options, prototype)
Define a configuration key.
  get(section, option)
Read the value of a global configuration key.
  load(fileName)
Load a configuration with the default prototype
  set(section, option, value)
Write the value of a global configuration key.

Variable Summary
NoneType config = None                                                                  
str encoding = 'iso-8859-1'
dict prototype = {'engine': {'tickrate': <Config.Option insta...

Function Details

define(section, option, type, default=None, text=None, options=None, prototype={'engine': {'tickrate': <Config.Option instance at 0x3d05...)

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)

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

load(fileName=None)

Load a configuration with the default prototype

set(section, option, value)

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

Variable Details

config

Type:
NoneType
Value:
None                                                                  

encoding

Type:
str
Value:
'iso-8859-1'                                                           

prototype

Type:
dict
Value:
{'audio': {'bits': <Config.Option instance at 0x3d06702c>,
           'buffersize': <Config.Option instance at 0x3d06706c>,
           'delay': <Config.Option instance at 0x3d06708c>,
           'frequency': <Config.Option instance at 0x3d065fec>,
           'stereo': <Config.Option instance at 0x3d06704c>},
 'engine': {'tickrate': <Config.Option instance at 0x3d0559ec>},
 'game': {'background_color': <Config.Option instance at 0x3bd9b46c>,
          'base_color': <Config.Option instance at 0x3d03544c>,
...                                                                    

Generated by Epydoc 2.1 on Thu Aug 31 00:17:50 2006 http://epydoc.sf.net