[Rest2web-develop] Refactoring
Brought to you by:
mjfoord
|
From: Michael F. <mi...@pc...> - 2005-07-21 18:38:33
|
*Phew* That was a lot easier than I imagined.=20
In fact I was wrong - ConfigObj *didn't* alter the structure of files it =
wrote back out. (Which meant it could generate files with values in the =
wrong place).
It now sticks to your proposed structure when generating new ConfigObjs =
as well. I've also changed Section to use separate scalars and sections =
attributes. It only took 15 minutes and all tests still pass - was very =
surprised. :-D
The only thing is it will still parse (now) invalid config files without =
raising an error :
key =3D val
key2 =3D val2
[ sect ]
key =3D val
key2 =3D val2
[sub-sect]
key =3D val
key2 =3D val2
[sub-sub-sect]
key =3D val
[sub-sect2]
key =3D val
key2 =3D val2
key3 =3D val
In the above file ``key3`` should raise an error. Currently it is put in =
sect.
All the best....
Fuzzy
Http://www.voidspace.org.uk/python
|