Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
pannous committed Jan 25, 2017
1 parent 9ef55af commit 7ffe154
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions transforms/norm-kast-xml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: interpy #{'ruby strings'}
from cStringIO import StringIO

fileName ='test.kast.xml'
Expand All @@ -15,11 +14,14 @@ def yml2xml(builder, body, tabs=0):
val=val or isinstance(v,str)
val=val or isinstance(v,bool)
if val:
builder.write( "\t"*tabs+"<#{k}>#{v}</#{k}>\n")
# builder.write( "\t"*tabs+"<#{k}>#{v}</#{k}>\n")
builder.write( "\t"*tabs+"<%s>%s</%s>\n"%(k,v,k))

else:
builder.write( "\t"*tabs+"<#{k}>\n")
builder.write( "\t"*tabs+"<"+k+">\n")
yml2xml(builder, v, tabs+1)
builder.write("\t"*tabs+"</#{k}>\n")
builder.write("\t"*tabs+"</"+k+">\n")

if (tabs==0 and len(body)>1): builder.write("</module>")
return builder

Expand Down

0 comments on commit 7ffe154

Please sign in to comment.