diff options
author | Mike Hommey <mh@glandium.org> | 2004-09-10 05:26:00 +0000 |
---|---|---|
committer | Mike Hommey <mh@glandium.org> | 2004-09-10 05:26:00 +0000 |
commit | 09deb06614c3408ec0816a3c88920138bae2083c (patch) | |
tree | a1b841a7dc28eecb98ca361c9371ecd1449a1908 /python/libxml.py | |
parent | c14c53a3645d81281058d4bb4cff24fa8d6faf33 (diff) | |
download | libxml2-09deb06614c3408ec0816a3c88920138bae2083c.tar.gz |
Load /tmp/tmp.BmUFjT/libxml2-2.6.13 intoupstream/2.6.13
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'python/libxml.py')
-rw-r--r-- | python/libxml.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/python/libxml.py b/python/libxml.py index 5980974..1036bd9 100644 --- a/python/libxml.py +++ b/python/libxml.py @@ -82,19 +82,19 @@ class ioWriteWrapper(ioWrapper): def __init__(self, _obj, enc = ""): # print "ioWriteWrapper.__init__", _obj if type(_obj) == type(''): - print "write io from a string" - self.o = None - elif type(_obj) == types.InstanceType: - print "write io from instance of %s" % (_obj.__class__) - ioWrapper.__init__(self, _obj) - self._o = libxml2mod.xmlCreateOutputBuffer(self, enc) - else: - file = libxml2mod.outputBufferGetPythonFile(_obj) - if file != None: - ioWrapper.__init__(self, file) - else: - ioWrapper.__init__(self, _obj) - self._o = _obj + print "write io from a string" + self.o = None + elif type(_obj) == types.InstanceType: + print "write io from instance of %s" % (_obj.__class__) + ioWrapper.__init__(self, _obj) + self._o = libxml2mod.xmlCreateOutputBuffer(self, enc) + else: + file = libxml2mod.outputBufferGetPythonFile(_obj) + if file != None: + ioWrapper.__init__(self, file) + else: + ioWrapper.__init__(self, _obj) + self._o = _obj def __del__(self): # print "__del__" @@ -488,19 +488,19 @@ class xmlCoreBreadthFirstItertor: # def nodeWrap(o): # TODO try to cast to the most appropriate node class - name = libxml2mod.name(o) + name = libxml2mod.type(o) if name == "element" or name == "text": return xmlNode(_obj=o) if name == "attribute": return xmlAttr(_obj=o) if name[0:8] == "document": return xmlDoc(_obj=o) - if name[0:8] == "namespace": + if name == "namespace": return xmlNs(_obj=o) if name == "elem_decl": return xmlElement(_obj=o) if name == "attribute_decl": - return xmlAtribute(_obj=o) + return xmlAttribute(_obj=o) if name == "entity_decl": return xmlEntity(_obj=o) if name == "dtd": |