mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-06-13 19:21:37 +03:00
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
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user