[Rest2web-develop] ConfigObj Commit
Brought to you by:
mjfoord
From: Michael F. <mi...@pc...> - 2005-07-08 08:03:07
|
Hello Nicola, Just committed more changes to ConfigObj. Renamed private attributes with a single underscore prefix. Changes to interpolation - exceeding recursion depth, or specifying a missing value, now raise errors. Changes for Python 2.2 compatibility. (changed boolean tests - removed ``is True`` and ``is False``) Added test for duplicate section and member (and fixed bug) I *might* have some time during the day to look at the validate issues. (type checking and type conversion). First of all I'll add stringify and transforming validation. This will do the type conversion when you write files and when you validate. Can you think of any config information you might want to store where the *type* of the value will be ambiguous ? For example any config options where you might want a string or a number ? The key thing is having a good standard set of validate functions that take care of all the common cases . Basic types : float decimal integer string date/time boolean None lists of any of these All these basic sorts it would be *very* simple to detect and automatically convert. Mark Andrews also favoured a regex approach as well - for things like post codes (zip codes), phone numbers, IP addresses. Obviously this will only check that the value matches the spec - not do any transformation. Can you tell that I'm procrastinating writing the ``writein`` method... Best Regards, Fuzzy http://www.voidspace.org.uk/python |