diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-01-14 11:42:39 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-01-14 11:42:39 +0000 |
commit | e6227e0549490b5bf9271ecd2d874a97c3f4852b (patch) | |
tree | 32063b798adcc671bd80f021aed0b76bd9bd1864 /python/libxml.py | |
parent | 4dbe77a84f4ff3c5785906e76adbc21bb6e259b4 (diff) | |
download | android_external_libxml2-e6227e0549490b5bf9271ecd2d874a97c3f4852b.tar.gz android_external_libxml2-e6227e0549490b5bf9271ecd2d874a97c3f4852b.tar.bz2 android_external_libxml2-e6227e0549490b5bf9271ecd2d874a97c3f4852b.zip |
applied and fixed a patch from Stephane Bibould to provide per parser
* python/generator.py python/libxml.c python/libxml.py
python/libxml_wrap.h python/types.c: applied and fixed a patch
from Stephane Bibould to provide per parser error handlers at the
Python level.
* python/tests/Makefile.am python/tests/ctxterror.py: added a
regression test for it.
Daniel
Diffstat (limited to 'python/libxml.py')
-rw-r--r-- | python/libxml.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/python/libxml.py b/python/libxml.py index d6c782d8..3e878919 100644 --- a/python/libxml.py +++ b/python/libxml.py @@ -478,6 +478,25 @@ def registerErrorHandler(f, ctx): ret = libxslt.registerErrorHandler(f,ctx) return ret +class parserCtxtCore: + + def __init__(self, _obj=None): + if _obj != None: + self._o = _obj; + return + self._o = None + + def __del__(self): + if self._o != None: + libxml2mod.xmlFreeParserCtxt(self._o) + self._o = None + + def registerErrorHandler(self,f,arg): + libxml2mod.xmlSetParserCtxtErrorHandler(self._o,f,arg) + + def registerWarningHandler(self,f,arg): + libxml2mod.xmlSetParserCtxtWarningHandler(self._o,f,arg) + # WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING # # Everything before this line comes from libxml.py |