##// END OF EJS Templates
La clase ParameterConf() evalua el valor de entrada como pairslist
Daniel Valdez -
r226:b26ae45d2d3c
parent child
Show More
@@ -69,6 +69,23 class ParameterConf():
69 if self.format == 'bool':
69 if self.format == 'bool':
70 value = int(value)
70 value = int(value)
71
71
72 if self.format == 'pairslist':
73 """
74 Example:
75 value = (0,1),(1,2)
76 """
77
78 value = value.replace('(', '')
79 value = value.replace(')', '')
80
81 strList = value.split(',')
82 intList = [int(item) for item in strList]
83 pairList = []
84 for i in range(len(intList)/2):
85 pairList.append((intList[i*2], intList[i*2 + 1]))
86
87 return pairList
88
72 func = eval(self.format)
89 func = eval(self.format)
73
90
74 return func(value)
91 return func(value)
General Comments 0
You need to be logged in to leave comments. Login now