analyze inkscape stderr to detect svg issues

This commit is contained in:
MaZderMind 2014-04-24 17:58:45 +02:00
parent 735d35801b
commit 36ec438c58

View file

@ -17,6 +17,7 @@ import tempfile
import threading import threading
import multiprocessing import multiprocessing
from threading import Thread, Lock from threading import Thread, Lock
import subprocess
from Queue import Queue from Queue import Queue
# URL to Schedule-XML # URL to Schedule-XML
@ -222,11 +223,16 @@ def render(infile, outfile, sequence, parameters={}, workdir='artwork'):
fp.write( etree.tostring(svg) ) fp.write( etree.tostring(svg) )
# invoke inkscape to convert the generated svg-file into a png inside the .frames-directory # invoke inkscape to convert the generated svg-file into a png inside the .frames-directory
os.system('cd {0} && inkscape --export-png=.frames/{1:04d}.png .gen.svg >/dev/null 2>&1'.format(workdir, frameNr)) errorReturn = subprocess.check_output('cd {0} && inkscape --export-png=.frames/{1:04d}.png .gen.svg 2>&1 >/dev/null'.format(workdir, frameNr), shell=True)
if errorReturn != '':
print "inkscape exitted with error\n"+errorReturn
sys.exit(42)
# incrwement frame-number # incrwement frame-number
frameNr += 1 frameNr += 1
# remove the dv we are about to (re-)generate # remove the dv we are about to (re-)generate
ensureFilesRemoved(os.path.join(workdir, outfile)) ensureFilesRemoved(os.path.join(workdir, outfile))