From: brendan s. <spa...@ya...> - 2005-11-08 15:01:26
|
Hi all, I'm just sitting down to write a new project, and I was considering using ConfigObj for my application. However I'm not sure how one would express the structure of my data in your file format. To illustrate, my data looks like something like this (in python): #-----------------begin example--------------------- param1 = 1 param2 = 2 #etc #the following is an arbitrarily long list models = [ Model( mParam1 = 4, mParam2 = 5, #etc #the following is another arbitrarily long list mListParams = [ mlParam1 = ModelInner( miParam1 = 6, miParam2 = 7 ), mlParam2 = ModelInner( miParam1 = 7, miParam2 = 8 ) ] ) Model( mParam1 = 4, mParam2 = 5, #etc #the following is another arbitrarily long list mListParams = [ mlParam1 = ModelInner( miParam1 = 6, miParam2 = 7 ), mlParam2 = ModelInner( miParam1 = 7, miParam2 = 8 ) ] # end of mListParams ) #end of model ] #end of models list #----------------end example-------------------------- Reading the ConfigObj docs, I can see how to make nested structure. But the parser seems heavily geared towards nested dictionaries. I'm not sure how to describe the nested lists. I could the lists into dicts before saving and after opening by giving them keys like "value1", "value2" etc, but I'd rather use a standard approach. Does ConfigObj have the facility to do this automatically? Thanks in advance, Brendan __________________________________________________________ Find your next car at http://autos.yahoo.ca |