* duzelt: list tag'inin encode metodu
* ulan ilk yaptigimda da boyle yazmistim o zaman neden calismadi :)
This commit is contained in:
+2
-4
@@ -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')
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user