##// END OF EJS Templates
tweak inkscape configurability...
MinRK -
Show More
@@ -29,9 +29,7 b' from .convertfigures import ConvertFiguresTransformer'
29 29 # Constants
30 30 #-----------------------------------------------------------------------------
31 31
32 INKSCAPE_COMMAND = 'inkscape --without-gui --export-pdf="{to_filename}" "{from_filename}"'
33 INKSCAPE_OSX_COMMAND = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape --without-gui --export-pdf="{to_filename}" "{from_filename}"'
34
32 INKSCAPE_APP = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape'
35 33
36 34 #-----------------------------------------------------------------------------
37 35 # Classes
@@ -44,6 +42,7 b' class SVG2PDFTransformer(ConvertFiguresTransformer):'
44 42
45 43 from_format = Unicode('svg', config=True, help='Format the converter accepts')
46 44 to_format = Unicode('pdf', config=False, help='Format the converter writes')
45
47 46 command = Unicode(config=True,
48 47 help="""The command to use for converting SVG to PDF
49 48
@@ -55,13 +54,15 b' class SVG2PDFTransformer(ConvertFiguresTransformer):'
55 54 """)
56 55
57 56 def _command_default(self):
57 return self.inkscape + \
58 ' --without-gui --export-pdf="{to_filename}" "{from_filename}"'
59
60 inkscape = Unicode(config=True, help="The path to Inkscape, if necessary")
61 def _inkscape_default(self):
58 62 if sys.platform == "darwin":
59 return INKSCAPE_OSX_COMMAND
60 elif sys.platform == "win32":
61 # windows not yet supported
62 return ""
63 else:
64 return INKSCAPE_COMMAND
63 if os.path.isfile(INKSCAPE_APP):
64 return INKSCAPE_APP
65 return "inkscape"
65 66
66 67
67 68 def convert_figure(self, data_format, data):
General Comments 0
You need to be logged in to leave comments. Login now