]> git.lyx.org Git - lyx.git/blob - lib/scripts/convertDefault.py
Generate python code in GraphicsConverter.C, replace convertDefault.sh by convertDefa...
[lyx.git] / lib / scripts / convertDefault.py
1 #!/usr/bin/env python
2
3 # file convertDefault.py
4 # This file is part of LyX, the document processor.
5 # Licence details can be found in the file COPYING.
6
7 # \author Herbert Voß
8 # \author Bo Peng
9
10 # Full author contact details are available in file CREDITS.
11
12 # The default converter if no other has been defined by the user from the
13 # Conversion->Converter tab of the Preferences dialog.
14
15 # The user can also redefine this default converter, placing their
16 # replacement in ~/.lyx/scripts
17
18 # converts an image from $1 to $2 format
19 import os, sys
20 if os.system(r'convert -depth 8 "%s" "%s"' % (sys.argv[1], sys.argv[2])) != 0:
21   print >> sys.stderr, sys.argv[0], 'ERROR'
22   print >> sys.stderr, 'Execution of "convert" failed.'
23   sys.exit(1)
24