1313from lib .core .data import paths
1414from lib .core .datatype import advancedDict
1515
16- def cleanupVals (values , tag ):
17- if isinstance ( values , basestring ):
18- return values
16+ def cleanupVals (text , tag ):
17+ if tag in ( "clause" , "where" ):
18+ text = text . split ( ',' )
1919
20- count = 0
21-
22- for value in values :
23- if value .isdigit ():
24- value = int (value )
20+ if isinstance (text , basestring ):
21+ if text .isdigit ():
22+ text = int (text )
2523 else :
26- value = str (value )
24+ text = str (text )
25+
26+ elif isinstance (text , list ):
27+ count = 0
28+
29+ for t in text :
30+ if t .isdigit ():
31+ t = int (t )
32+ else :
33+ t = str (t )
2734
28- values [count ] = value
29- count += 1
35+ text [count ] = t
36+ count += 1
3037
31- if len (values ) == 1 and tag not in ("clause" , "where" ):
32- values = values [0 ]
38+ if len (text ) == 1 and tag not in ("clause" , "where" ):
39+ text = text [0 ]
3340
34- return values
41+ return text
3542
3643def parseXmlNode (node ):
3744 for element in node .getiterator ('boundary' ):
3845 boundary = advancedDict ()
3946
4047 for child in element .getchildren ():
4148 if child .text :
42- values = cleanupVals (child .text . split ( ',' ) , child .tag )
49+ values = cleanupVals (child .text , child .tag )
4350 boundary [child .tag ] = values
4451 else :
4552 boundary [child .tag ] = None
@@ -51,7 +58,7 @@ def parseXmlNode(node):
5158
5259 for child in element .getchildren ():
5360 if child .text and child .text .strip ():
54- values = cleanupVals (child .text . split ( ',' ) if child . tag != "epayload" else child . text , child .tag )
61+ values = cleanupVals (child .text , child .tag )
5562 test [child .tag ] = values
5663 else :
5764 if len (child .getchildren ()) == 0 :
0 commit comments