h = script.attrib['height']
color = color_from_style(script.attrib['style'])
output_file.write("%s %s %s %s %s\n" % (x, y, w, h, color))
- # TODO(#509): script may have more than one child
- [title] = [child for child in script]
- command_line = title.text.split()
- with open(command_line[0], 'r') as script_file:
- script_lines = script_file.read().splitlines()
- output_file.write("%d\n" % (len(script_lines) + 1))
- output_file.write("(set args %s)\n" % list_as_sexpr(command_line[1:]))
- for script_line in script_lines:
- output_file.write("%s\n" % script_line)
+
+ for title in script:
+ command_line = title.text.split()
+ with open(command_line[0], 'r') as script_file:
+ script_lines = script_file.read().splitlines()
+ output_file.write("%d\n" % (len(script_lines) + 1))
+ output_file.write("(set args %s)\n" % list_as_sexpr(command_line[1:]))
+ for script_line in script_lines:
+ output_file.write("%s\n" % script_line)
def svg2rects(svg_file_name, output_file_name):
svg_tree = ET.parse(svg_file_name)