mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
fixed bug #102181 by applying the suggested change and fixing the
* python/libxml.py python/libxml.c python/libxml2-python-api.xml: fixed bug #102181 by applying the suggested change and fixing the generation/registration problem. Daniel
This commit is contained in:
@ -2195,6 +2195,7 @@ static PyMethodDef libxmlMethods[] = {
|
||||
{(char *) "outputBufferCreate", libxml_xmlCreateOutputBuffer, METH_VARARGS, NULL},
|
||||
{(char *) "inputBufferCreate", libxml_xmlCreateInputBuffer, METH_VARARGS, NULL},
|
||||
{(char *) "setEntityLoader", libxml_xmlSetEntityLoader, METH_VARARGS, NULL},
|
||||
{(char *)"xmlRegisterErrorHandler", libxml_xmlRegisterErrorHandler, METH_VARARGS, NULL },
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
|
@ -462,6 +462,26 @@ PARSER_VALIDATE=3
|
||||
PARSER_SUBST_ENTITIES=4
|
||||
|
||||
#
|
||||
# Everything below this point is automatically generated
|
||||
# register the libxml2 error handler
|
||||
#
|
||||
def registerErrorHandler(f, ctx):
|
||||
"""Register a Python written function to for error reporting.
|
||||
The function is called back as f(ctx, error). """
|
||||
import sys
|
||||
if not sys.modules.has_key('libxslt'):
|
||||
# normal behaviour when libxslt is not imported
|
||||
ret = libxml2mod.xmlRegisterErrorHandler(f,ctx)
|
||||
else:
|
||||
# when libxslt is already imported, one must
|
||||
# use libxst's error handler instead
|
||||
import libxslt
|
||||
ret = libxslt.registerErrorHandler(f,ctx)
|
||||
return ret
|
||||
|
||||
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
||||
#
|
||||
# Everything before this line comes from libxml.py
|
||||
# Everything after this line is automatically generated
|
||||
#
|
||||
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
||||
|
||||
|
@ -14,12 +14,6 @@
|
||||
<return type='xmlNodePtr' info="A new element node"/>
|
||||
<arg name='name' type='xmlChar *' info='the node name'/>
|
||||
</function>
|
||||
<function name='xmlRegisterErrorHandler' file='python'>
|
||||
<info>Register a Python written function to for error reporting. The function is called back as f(ctx, error).</info>
|
||||
<return type='int' info="1 in case of success, 0 or -1 in case of error"/>
|
||||
<arg name='f' type='pythonObject' info='the python function'/>
|
||||
<arg name='ctx' type='pythonObject' info='a context for the callback'/>
|
||||
</function>
|
||||
<function name='xmlCreatePushParser' file='python'>
|
||||
<info>Create a progressive XML parser context to build either an event flow if the SAX object is not None, or a DOM tree otherwise.</info>
|
||||
<return type='xmlParserCtxtPtr' info="the parser context or None in case of error"/>
|
||||
|
@ -124,7 +124,6 @@ dumpMemory()
|
||||
htmlCreatePushParser()
|
||||
htmlSAXParseFile()
|
||||
newNode()
|
||||
registerErrorHandler()
|
||||
setEntityLoader()
|
||||
|
||||
# functions from module tree
|
||||
|
Reference in New Issue
Block a user