|
From: Michael F. <fuz...@vo...> - 2011-01-05 18:28:30
|
On 05/01/2011 14:26, Stefan Parviainen wrote: > Hi all, > > I created a clone of ConfigObj on Google Code > (http://code.google.com/r/pafcu-configobj/) where I will put any fixes > and improvements to ConfigObj and Validator that I can come up with. > Right now the only thing I have added is an improved list syntax > allowing you to specify what type list members should have. You can > also specify whether a tuple or list should be used. > Cool. When you're happy with what you've done could you create an issue on the configobj issue tracker and attach a patch please. https://code.google.com/p/configobj/issues/list All the best, Michael Foord > Now you can e.g. define a tuple containing ints between 1 and 10 by doing > > mylist = list(type="integer(min=1, max=10)", is_tuple=True) > > This should also work for custom types. > > In theory we could now get rid of all the XXX_list types, but for > backwards compatibility I have left them in for now. They are a > convinient short-hand notation, but at the very lest they should be > renamed so they match their corresponding non-list type (e.g. rename > int_list -> integer_list OR integer -> int). I also left in the > top-level is_list() and is_tuple() functions which have the old > behaviour for backwards compatibility. > > Old tests are passed and I added some new ones to check that the new > syntax also works as expected. > -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html |