Mercurial > MadButterfly
comparison tools/svg2code.py @ 65:35c2b7ba140b
Use file name of generated M4 script as name of header
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 13 Aug 2008 02:11:55 +0800 |
parents | c668c5c3ceae |
children | 3645e29e4986 |
comparison
equal
deleted
inserted
replaced
64:c668c5c3ceae | 65:35c2b7ba140b |
---|---|
213 codefn = 'out.mb' | 213 codefn = 'out.mb' |
214 else: | 214 else: |
215 print >> sys.stderr, '%s <SVG file> [<output>]' % (sys.argv[0]) | 215 print >> sys.stderr, '%s <SVG file> [<output>]' % (sys.argv[0]) |
216 pass | 216 pass |
217 | 217 |
218 struct_name = path.basename(svgfn).split('.')[0] | 218 struct_name = path.basename(codefn).split('.')[0] |
219 | 219 |
220 dom = parse(svgfn) | 220 dom = parse(svgfn) |
221 codefo = file(codefn, 'w+') | 221 codefo = file(codefn, 'w+') |
222 print >> codefo, 'MADBUTTERFLY([%s],[dnl' % (struct_name) | 222 print >> codefo, 'MADBUTTERFLY([%s],[dnl' % (struct_name) |
223 svg_2_code(dom, codefo) | 223 svg_2_code(dom, codefo) |