Fix SVG merging for Inkscape

Resolves: #163
This commit is contained in:
Florian Festi 2019-08-16 22:36:12 +02:00
parent d51b44fb57
commit 0409bcbe65
1 changed files with 3 additions and 5 deletions

View File

@ -248,10 +248,8 @@ def ticksPerMM(tree):
def svgMerge(box, inkscape, output):
parser = ElementTree.XMLParser(remove_blank_text=True)
src_tree = ElementTree.parse(box, parser)
dest_tree = ElementTree.parse(inkscape, parser)
src_tree = ElementTree.parse(box)
dest_tree = ElementTree.parse(inkscape)
dest_root = dest_tree.getroot()
src_width, src_height = getSizeInMM(src_tree)
@ -276,7 +274,7 @@ def svgMerge(box, inkscape, output):
scale_x, scale_y, off_x, off_y))
# write the xml file
ElementTree.ElementTree(dest_root).write(output, pretty_print=True, encoding='utf-8', xml_declaration=True)
ElementTree.ElementTree(dest_root).write(output, encoding='utf-8', xml_declaration=True)
if __name__ == "__main__":
svg = SVGFile("examples/box.svg")