-#!/usr/bin/env python
# -*- coding: utf-8 -*-
# file fig2pdf.py
#
-import os, sys, re, locale
+import os, sys, re
def runCommand(cmd):
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):
# The generated PostScript commands are extracted from epstopdf, distributed
# with tetex.
epsfile = outbase + '.pstex'
- tmp = open(epsfile + '.??', 'w')
+ tmp = mkstemp()
boundingboxline = re.compile('%%BoundingBox:\s+(\d*)\s+(\d*)\s+(\d*)\s+(\d*)')
for line in open(epsfile).xreadlines():
if line[:13] == '%%BoundingBox':