* duzelt: list tag'inin encode metodu

* ulan ilk yaptigimda da boyle yazmistim o zaman neden calismadi :)
This commit is contained in:
Eray Özkural
2005-09-28 13:27:50 +00:00
parent 3efd77eb59
commit 5b4c7ad077
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -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')
+1 -1
View File
@@ -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()