mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
applied patch from Brent M Hendricks adding binding for xmlCatalogAddLocal
* python/libxml.c python/libxml.py: applied patch from Brent M Hendricks adding binding for xmlCatalogAddLocal Daniel
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Wed Apr 23 09:35:12 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* python/libxml.c python/libxml.py: applied patch from
|
||||||
|
Brent M Hendricks adding binding for xmlCatalogAddLocal
|
||||||
|
|
||||||
Tue Apr 22 15:18:01 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
Tue Apr 22 15:18:01 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* HTMLparser.c: tried to fix #98879 again in a more solid
|
* HTMLparser.c: tried to fix #98879 again in a more solid
|
||||||
|
@ -2545,6 +2545,36 @@ libxml_xmlNewNode(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
|
|||||||
return (py_retval);
|
return (py_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************
|
||||||
|
* *
|
||||||
|
* Local Catalog stuff *
|
||||||
|
* *
|
||||||
|
************************************************************************/
|
||||||
|
static PyObject *
|
||||||
|
libxml_addLocalCatalog(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
|
||||||
|
{
|
||||||
|
xmlChar *URL;
|
||||||
|
xmlParserCtxtPtr ctxt;
|
||||||
|
PyObject *pyobj_ctxt;
|
||||||
|
|
||||||
|
if (!PyArg_ParseTuple(args, (char *)"Os:addLocalCatalog", &pyobj_ctxt, &URL))
|
||||||
|
return(NULL);
|
||||||
|
|
||||||
|
ctxt = (xmlParserCtxtPtr) PyparserCtxt_Get(pyobj_ctxt);
|
||||||
|
|
||||||
|
if (URL != NULL) {
|
||||||
|
ctxt->catalogs = xmlCatalogAddLocal(ctxt->catalogs, URL);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("LocalCatalog: %s\n", URL);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return (Py_None);
|
||||||
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* The registration stuff *
|
* The registration stuff *
|
||||||
@ -2574,6 +2604,7 @@ static PyMethodDef libxmlMethods[] = {
|
|||||||
{(char *)"xmlTextReaderSetErrorHandler", libxml_xmlTextReaderSetErrorHandler, METH_VARARGS, NULL },
|
{(char *)"xmlTextReaderSetErrorHandler", libxml_xmlTextReaderSetErrorHandler, METH_VARARGS, NULL },
|
||||||
{(char *)"xmlTextReaderGetErrorHandler", libxml_xmlTextReaderGetErrorHandler, METH_VARARGS, NULL },
|
{(char *)"xmlTextReaderGetErrorHandler", libxml_xmlTextReaderGetErrorHandler, METH_VARARGS, NULL },
|
||||||
{(char *)"xmlFreeTextReader", libxml_xmlFreeTextReader, METH_VARARGS, NULL },
|
{(char *)"xmlFreeTextReader", libxml_xmlFreeTextReader, METH_VARARGS, NULL },
|
||||||
|
{(char *)"addLocalCatalog", libxml_addLocalCatalog, METH_VARARGS, NULL },
|
||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -511,6 +511,11 @@ class parserCtxtCore:
|
|||||||
or (None,None)."""
|
or (None,None)."""
|
||||||
return libxml2mod.xmlParserCtxtGetErrorHandler(self._o)
|
return libxml2mod.xmlParserCtxtGetErrorHandler(self._o)
|
||||||
|
|
||||||
|
def addLocalCatalog(self, uri):
|
||||||
|
"""Register a local catalog with the parser"""
|
||||||
|
return libxml2mod.addLocalCatalog(self._o, uri)
|
||||||
|
|
||||||
|
|
||||||
def _xmlTextReaderErrorFunc((f,arg),msg,severity,locator):
|
def _xmlTextReaderErrorFunc((f,arg),msg,severity,locator):
|
||||||
"""Intermediate callback to wrap the locator"""
|
"""Intermediate callback to wrap the locator"""
|
||||||
return f(arg,msg,severity,xmlTextReaderLocator(locator))
|
return f(arg,msg,severity,xmlTextReaderLocator(locator))
|
||||||
|
Reference in New Issue
Block a user