Config

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, setAsDefault)` 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 0x41ce...) 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, setAsDefault=False) 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 0x41cee7ec>,
                   'buffersize': <Config.Option instance at 0x41cee82c>,
                   'delay': <Config.Option instance at 0x41cee84c>,
                   'frequency': <Config.Option instance at 0x41cee7cc>,
                   'screwupvol': <Config.Option instance at 0x41cf0f4c>,
                   'stereo': <Config.Option instance at 0x41cee80c>},
         'engine': {'tickrate': <Config.Option instance at 0x41ceb7ac>},
         'game': {'language': <Config.Option instance at 0x41692f4c>,
        ...

Generated by Epydoc 2.1 on Thu Nov 23 23:40:42 2006 | http://epydoc.sf.net