SupyML: make the <while> works and fix testWhile
parent
a486749808
commit
09fb7b36ab
|
@ -170,12 +170,15 @@ class SupyMLParser:
|
|||
raise LoopTypeIsMissing(node.toxml())
|
||||
elif loopType is None:
|
||||
loopType = childNode.nodeName
|
||||
loopCond = childNode.toxml()[len('<while>'):-len('</while>')]
|
||||
loopCond = childNode.toxml()
|
||||
loopCond = loopCond[len(loopType+'<>'):-len(loopType+'</>')]
|
||||
else:
|
||||
loopContent += childNode.toxml()
|
||||
if loopType == 'while':
|
||||
try:
|
||||
while utils.str.toBool(self._parse(loopCond, variables, True)):
|
||||
while utils.str.toBool(self._parse(loopCond, variables,
|
||||
True).split(': ')[1]):
|
||||
loopContent = '<echo>%s</echo>' % loopContent
|
||||
output += self._parse(loopContent)
|
||||
except AttributeError: # toBool() failed
|
||||
pass
|
||||
|
|
|
@ -115,7 +115,7 @@ class SupyMLTestCase(ChannelPluginTestCase):
|
|||
'</echo>'
|
||||
'</loop>'
|
||||
'</echo>',
|
||||
'barbar')
|
||||
'bar')
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||
|
|
Loading…
Reference in New Issue