|
From: Michael F. <fuz...@vo...> - 2006-12-12 10:54:24
|
Michael Holzt wrote:
> I have severe problems getting interpolation work for me. I have a
> config file with e.g. the following content:
>
> | [object]
> | field1: test test test %(uid)s
>
> The uid-value is not defined in the config file but shall be set on
> runtime. I can't figure out how to set the value, i always end up
> with 'MissingInterpolationOption' or other errors (e.g. KeyError).
>
> I tried for example config['DEFAULT']['uid'] = 'user' (KeyError),
You need to create the DEFAULT section first.
Try :
config['DEFAULT'] = {'uid': 'user'}
> config['uid'] = 'user' (MissingInterpolationOption).
ConfigObj uses the DEFAULT section or (current SVN only) the current
section for interpolation values.
As mentioned before, in order to use the DEFAULT section it must exist.
Fuzzyman
http://www.voidspace.org.uk/index2.shtml
> I'm sure i
> make a simple mistake, but i can't figure it out. Some help would
> be appreciated.
>
>
> Regards
> Michael
>
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.15.16/582 - Release Date: 11/12/2006
|