]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/fig2pstex.py
FindAdv: Ignore comment-feature (but not its content)
[lyx.git] / lib / scripts / fig2pstex.py
index c474d1b09d780325f5cf469f46c1e43cff2ce35c..90e163de40b2819b3a1d134e1a48b062117afa67 100644 (file)
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 # file fig2pstex.py
 #   the real eps file will be overwritten by a tex file named file.eps.
 #
 
-import os, sys, locale
+from __future__ import print_function
+import os, sys
 
 # We expect two args, the names of the input and output files.
 if len(sys.argv) != 3:
     sys.exit(1)
 
-language, output_encoding = locale.getdefaultlocale()
-if output_encoding == None:
-    output_encoding = 'latin1'
-
-input = unicode(sys.argv[1], 'utf8').encode(output_encoding)
-output = unicode(sys.argv[2], 'utf8').encode(output_encoding)
+input, output = sys.argv[1:]
 
 # Fail silently if the file doesn't exist
 if not os.path.isfile(input):
@@ -51,5 +46,5 @@ outbase = os.path.splitext(output)[0]
 # Generate the PSTEX_T file
 if os.system('fig2dev -Lpstex %s %s.eps' % (input, outbase)) != 0 or \
   os.system('fig2dev -Lpstex_t -p%s %s %s' % (outbase, input, output)) != 0:
-  print 'fig2dev fails'
+  print ('fig2dev fails')
   sys.exit(1)