Re: [xml] structured errors in python bindings

On Fri, Jan 02, 2004 at 11:52:52PM +0100, Stïphane Bidoul wrote:
Hi Daniel,

  Hi Stïphane,

I knew I was forgotting to answer some posts, sorry for the late reply

Here's a first try of mine to add structured
error handling in the python bindings. 

I trust you, you know the python framework better than me.

Basically, only xmlGetLastError() is supported 
with this patch. Still TODO: 
- structured error handling callbacks
- per context lastError
- something else?

If the patch looks clean, you can commit,
and I'll continue as time permits.

  Okay I will commit it soonish

Also, I'm wondering if you'd consider accepting
new python tests written using the unittest module?
It's available since python 2.1 and available
as a separate download for 1.5 and 2.0.
It does not do that much but it tends to give
more structure to the tests, it makes it easier to
spot errors when they occurs, it's easy to
add memory debugging around each test 
(in setUp/tearDown), etc.
The attached illustrates this,
tell me what you think.

  I have mixed feelings about this. The portability 
might be a bit of a problem but in my opinion the main
problem is taht it makes reading the test harder. It is
useful to be able to point people to the Python tests as
examples of programming libxml2 Python bindings, and the
unittest framework make itless readable. It's a bit like
the difference between xmllint.c code and the examples 
doc/examples/ directory. On the other hand more tests is
always good so if it makes it easier or more interesting
for you to generate those test then go ahead !

  Also I think I didn't replied to your suggestion to
rewrite a compatible Python XML layer based on the SAX2 
native interface, yes I thik this would make a lot of sense
but I doubt I can focuse on it myself.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]