mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
cleanup added class for parser context, added first cut for push mode
* python/Makefile.am python/types.c: cleanup * python/libxml.c python/libxml.py python/libxml_wrap.h python/generator.py python/libxml2-python-api.xml python/libxml2class.txt: added class for parser context, added first cut for push mode support. Added a framework to generate accessors functions. * python/tests/Makefile.am python/tests/push.py: added a push test Daniel
This commit is contained in:
@ -4,6 +4,7 @@ TESTS= \
|
||||
tst.py \
|
||||
tstxpath.py \
|
||||
xpathext.py \
|
||||
push.py \
|
||||
error.py \
|
||||
xpath.py
|
||||
|
||||
@ -20,6 +21,9 @@ else
|
||||
tests:
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -f *.pyc core
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(EXAMPLE_DIR)
|
||||
-(for test in $(TESTS) $(XMLS); \
|
||||
|
25
python/tests/push.py
Executable file
25
python/tests/push.py
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/python -u
|
||||
import sys
|
||||
import libxml2
|
||||
|
||||
ctxt = libxml2.createPushParser(None, "<foo", 4, "test.xml")
|
||||
ctxt.parseChunk("/>", 2, 1)
|
||||
doc = ctxt.doc()
|
||||
ctxt=None
|
||||
if doc.name != "test.xml":
|
||||
print "document name error"
|
||||
sys.exit(1)
|
||||
root = doc.children
|
||||
if root.name != "foo":
|
||||
print "root element name error"
|
||||
sys.exit(1)
|
||||
doc.freeDoc()
|
||||
i = 10000
|
||||
while i > 0:
|
||||
ctxt = libxml2.createPushParser(None, "<foo", 4, "test.xml")
|
||||
ctxt.parseChunk("/>", 2, 1)
|
||||
doc = ctxt.doc()
|
||||
doc.freeDoc()
|
||||
i = i -1
|
||||
ctxt=None
|
||||
print "OK"
|
Reference in New Issue
Block a user