From 4c7f4816344e9e346f4c81c3fe8c13e7d8052333 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Wed, 28 Aug 2019 09:21:54 +0200 Subject: [PATCH] Fix refactoring errors --- renderlib.py | 3 +-- svgtemplate.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/renderlib.py b/renderlib.py index 0f99adf..01a0363 100644 --- a/renderlib.py +++ b/renderlib.py @@ -84,7 +84,6 @@ def ensureFilesRemoved(pattern): def renderFrame(infile, task, outfile): width = 1920 height = 1080 - infile = '{0}/.gen.svg'.format(task.workdir) if args.imagemagick: # invoke imagemagick to convert the generated svg-file into a png inside the .frames-directory with Image(filename=infile) as img: @@ -92,7 +91,7 @@ def renderFrame(infile, task, outfile): converted.save(filename=outfile) else: # invoke inkscape to convert the generated svg-file into a png inside the .frames-directory - cmd = 'cd {0} && inkscape --export-background=white --export-background-opacity=0 --export-width={1} --export-height={2} --export-png="{3}" "{4}" 2>&1 >/dev/null'.format(task.workdir, width, height, outfile, infile) + cmd = 'inkscape --export-background=white --export-background-opacity=0 --export-width={1} --export-height={2} --export-png="{3}" "{4}" 2>&1 >/dev/null'.format(task.workdir, width, height, outfile, infile) errorReturn = subprocess.check_output(cmd, shell=True, universal_newlines=True, stderr=subprocess.STDOUT) if errorReturn != '': print("inkscape exitted with error\n" + errorReturn) diff --git a/svgtemplate.py b/svgtemplate.py index f6797b0..5452688 100644 --- a/svgtemplate.py +++ b/svgtemplate.py @@ -48,7 +48,7 @@ class SVGTemplate: # if '$subtitle' in task.parameters and task.parameters['$subtitle'] == '': # child = svg.findall(".//*[@id='subtitle']")[0] # child.getparent().remove(child) - self.xmlstr = etree.tostring(svg, encoding='unicode') + self.svgstr = etree.tostring(svg, encoding='unicode') def __exit__(self, exception_type, exception_value, traceback): pass