1
0
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:
Daniel Veillard
2002-02-03 15:08:05 +00:00
parent cfb0546244
commit 3ce5257b29
11 changed files with 528 additions and 423 deletions

View File

@ -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
View 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"