Skip to content

Commit

Permalink
inkscape: Handle changes in Inkscape 1.0
Browse files Browse the repository at this point in the history
Inkscape 1.0 final has replaced the '--export-file' argument with
'--export-filename' [1]. Update our calls accordingly.

[1] https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0#Command_Line

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: rst2pdf#869
  • Loading branch information
stephenfin committed Jun 5, 2020
1 parent 48305e3 commit 68d4ed7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rst2pdf/extensions/inkscape_r2p.py
Expand Up @@ -69,11 +69,12 @@ def __init__(
# Inkscape 0.x uses -A
cmd = [progname, os.path.abspath(filename), '-A', pdffname]
else:
# Inkscape 1.x uses --export-file
# Inkscape 1.x uses --export-filename
cmd = [
progname,
os.path.abspath(filename),
'--export-file=%s' % pdffname,
'--export-filename',
pdffname,
]
try:
result = subprocess.call(cmd)
Expand Down Expand Up @@ -119,11 +120,12 @@ def raster(self, filename, client):
str(client.def_dpi),
]
else:
# Inkscape 1.x uses --export-file
# Inkscape 1.x uses --export-filename
cmd = [
progname,
os.path.abspath(filename),
'--export-file=%s' % pngfname,
'--export-filename',
pngfname,
'-d',
str(client.def_dpi),
]
Expand Down

0 comments on commit 68d4ed7

Please sign in to comment.