* 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
|
return l
|
||||||
|
|
||||||
def encode(xml, node, l):
|
def encode(xml, node, l):
|
||||||
listnode = xml.newNode(tag)
|
|
||||||
if len(l) > 0:
|
if len(l) > 0:
|
||||||
|
listnode = xml.newNode(tag)
|
||||||
for item in l:
|
for item in l:
|
||||||
encode_item(xml, listnode, item)
|
encode_item(xml, listnode, item)
|
||||||
#item_node = encode_item(xml, item)
|
node.appendChild(listnode)
|
||||||
#xml.addNodeUnder(listnode, comp_tag, item_node)
|
|
||||||
#return getNode(dummy, "Dummy")
|
|
||||||
else:
|
else:
|
||||||
if req is mandatory:
|
if req is mandatory:
|
||||||
raise Error('Mandatory list empty')
|
raise Error('Mandatory list empty')
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class XmlFileTestCase(unittest.TestCase):
|
|||||||
t_Number = [types.IntType, xmlfile.optional]
|
t_Number = [types.IntType, xmlfile.optional]
|
||||||
t_Email = [types.StringType, xmlfile.optional]
|
t_Email = [types.StringType, xmlfile.optional]
|
||||||
a_href = [types.StringType, xmlfile.mandatory]
|
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 ]
|
t_OtherInfo = [ OtherInfo, xmlfile.optional ]
|
||||||
|
|
||||||
a = A()
|
a = A()
|
||||||
|
|||||||
Reference in New Issue
Block a user