On Thu, 7 Sep 2006, Joerg Lehmann wrote:
On 07.09.06, Dag Wieers wrote:
To read out and update my configuration using multiple config-files. Of course the default config-file must be taken from somewhere and I allow to do -c config-file and that one is used by the Config class.
It is not the best way and there are some corner cases like you cannot have includes inside included files and the order (sorted) of the configuration-files is important. But Yam prints out the final configuration if you enable a certain verbosity and that should help debugging complex cases. The default configuration files are fairly simple though.
I think Alex was exactly speaking about includes, which, as you said, are not supported by the ConfigParser module.
Ok. My point was that you could do includes the same way: [main] includedir = /etc/pytone or [main] includes = /etc/pytone/*.conf or [main] includedir = /etc/pytone includes = audio.conf layout.conf databases.conf And similarly to the code I send you, use the configuration option as input to the Config class. I only allow to set or change the includedir in Yam, but the same technique can be used to specify it more detailed. Kind regards, -- dag wieers, dag@wieers.com, http://dag.wieers.com/ -- [all I want is a warm bed and a kind word and unlimited power]