From 5b4c7ad0774028c74582e4fc70c4949eec4bb707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Wed, 28 Sep 2005 13:27:50 +0000 Subject: [PATCH] * duzelt: list tag'inin encode metodu * ulan ilk yaptigimda da boyle yazmistim o zaman neden calismadi :) --- pisi/xmlfile.py | 6 ++---- tests/xmlfiletests.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pisi/xmlfile.py b/pisi/xmlfile.py index a2fed598..746bb8c3 100644 --- a/pisi/xmlfile.py +++ b/pisi/xmlfile.py @@ -462,13 +462,11 @@ class autoxml(type): return l def encode(xml, node, l): - listnode = xml.newNode(tag) if len(l) > 0: + listnode = xml.newNode(tag) for item in l: encode_item(xml, listnode, item) - #item_node = encode_item(xml, item) - #xml.addNodeUnder(listnode, comp_tag, item_node) - #return getNode(dummy, "Dummy") + node.appendChild(listnode) else: if req is mandatory: raise Error('Mandatory list empty') diff --git a/tests/xmlfiletests.py b/tests/xmlfiletests.py index 64a1bb82..b11ed2cf 100644 --- a/tests/xmlfiletests.py +++ b/tests/xmlfiletests.py @@ -40,7 +40,7 @@ class XmlFileTestCase(unittest.TestCase): t_Number = [types.IntType, xmlfile.optional] t_Email = [types.StringType, xmlfile.optional] a_href = [types.StringType, xmlfile.mandatory] - #t_Projects = [ [types.StringType], xmlfile.mandatory, 'Project'] + t_Projects = [ [types.StringType], xmlfile.mandatory, 'Project'] t_OtherInfo = [ OtherInfo, xmlfile.optional ] a = A()