]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/svg2pdftex.py
Use footnotehyper rather than footnote if hyperref is used
[lyx.git] / lib / scripts / svg2pdftex.py
index 56ac22edd46bb1e824df1652cea24ed7d495dab0..d1e0bf33a81f62182292cb2d26c28a9e75cd98e6 100644 (file)
 #   the real PDF file would be overwritten by a TeX file named outputfile.pdf.
 #
 
+from __future__ import print_function
+
 import os, sys, re, subprocess
 
 def runCommand(cmd):
     ''' Utility function:
         run a command, quit if fails
     '''
-    if subprocess.call(cmd) != 0:
-        print "Command '%s' fails." % cmd
+    res = subprocess.check_call(cmd)
+    if res != 0:
+        print("Command '%s' fails (exit code: %i)." % (res.cmd, res.returncode))
         sys.exit(1)
 
 InkscapeCmd = "inkscape"
@@ -65,7 +68,7 @@ OutBase = os.path.splitext(OutputFile)[0]
 # while outsourcing the text to a LaTeX file ${OutBase}.pdf_tex which includes and overlays
 # the PDF image and can be \input to LaTeX files. We rename the latter file to ${OutputFile}
 # (although this is probably the name it already has).
-runCommand([InkscapeCmd, '--file=%s' % (InputFile), '--export-pdf=%s.pdf' % (OutBase), '--export-latex'])
+runCommand([r'%s' % InkscapeCmd, '--file=%s' % InputFile, '--export-pdf=%s.pdf' % OutBase, '--export-latex'])
 
 os.rename('%s.pdf_tex' % OutBase, OutputFile)