|
From: Fuzzyman <fuz...@vo...> - 2005-12-05 08:40:05
|
Matthew Brett wrote:
>No problem, thanks very much for letting me know...
>
>
>
Hello Matthew,
I don't think my previous answer addressed all the issues you were
asking about.
I realise that you also want to include in your list *why* the test
failed. Again the question is "in what form do you want these error
messages" ?
Obviously the information you have to go off is the original test (or if
the entry is just plain missing) - if you had a flattened list of
failures (of the sort I discussed) you could have each entry as a tuple :
(entry_name, original_test)
You would still have to produce your own error messages from these of
course - would it be useful if I showed you a (recursive) function to
produce a list like this ?
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
>On 12/3/05, Fuzzyman <fuz...@vo...> wrote:
>
>
>>Hello Matthew,
>>
>>I'm very short of time - I'll do you a proper reply on Monday, sorry
>>about that.
>>
>>Michael
>>
>>Matthew Brett wrote:
>>
>>
>>
>>>Hi,
>>>
>>>I am very sorry if I missed something simple, but is there an easy way
>>>to get a list of informative validation error messages from the
>>>ConfigObj.validate interface?
>>>
>>>I have run:
>>>
>>>res = config_obj.validate(vtor)
>>>
>>>and have a nested list of boolean values - but I want to be able to
>>>print out a list of items that failed validation and why. I am just
>>>thinking about reiterating through the option dictionary, running the
>>>validation by hand (.check) for each False in the 'res' dictionary,
>>>but this seems very cludgy - is there a better way?
>>>
>>>Thanks a lot,
>>>
>>>Matthew
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
>>>for problems? Stop! Download the new AJAX search engine that makes
>>>searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
>>>http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
>>>_______________________________________________
>>>Configobj-develop mailing list
>>>Con...@li...
>>>https://lists.sourceforge.net/lists/listinfo/configobj-develop
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
|