From 175e4618a2262a0ff5887b9954760caf2457e3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Wed, 2 Nov 2005 02:04:10 +0000 Subject: [PATCH] * fix: make list encoding work again. I'm telling you, xmlext is elegant. * errr. note for a suspicious line in xmlext.addNode --- pisi/xmlext.py | 6 ++++-- pisi/xmlfile.py | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pisi/xmlext.py b/pisi/xmlext.py index 97819846..51f572cf 100644 --- a/pisi/xmlext.py +++ b/pisi/xmlext.py @@ -132,7 +132,9 @@ def addTagPath(dom, node, tags, newnode=None): return node def addNode(dom, node, tagpath, newnode = None): - """add a new node at the end of the tree""" + """add a new node at the end of the tree + if newnode is given adds that node, too + returns the last node processed""" assert type(tagpath)==str tags = [] @@ -140,7 +142,7 @@ def addNode(dom, node, tagpath, newnode = None): tags = tagpath.split('/') # tag chain else: addTagPath(dom, node, [], newnode) - return node + return node #FIXME: is this correct!?!? assert len(tags)>0 # we want a chain diff --git a/pisi/xmlfile.py b/pisi/xmlfile.py index c9ac0e20..b981f82b 100644 --- a/pisi/xmlfile.py +++ b/pisi/xmlfile.py @@ -623,10 +623,8 @@ class autoxml(oo.autosuper): dom = node.ownerDocument if l and len(l) > 0: for item in l: - listnode = xml.newNode("Dummy") + listnode = addNode(dom, node, list_tagpath) encode_item(xml, listnode, item, errs) - node = getNode(listnode, comp_tag) - addNode(dom, node, path) else: if req is mandatory: errs.append(_('Mandatory list empty'))