Skip to content

Commit

Permalink
change print to Py3 compatiable
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglongqi authored Oct 2, 2018
1 parent db12282 commit ac1105f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions writetex.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
This file is a part of WriteTeX extension for Inkscape. For more information,
please refer to http://wanglongqi.github.io/WriteTeX.
"""

from __future__ import print_function
import inkex
import os
import tempfile
Expand Down Expand Up @@ -90,10 +90,10 @@ def effect(self):
# p.remove(node)
p.append(doc)
else:
print >>sys.stderr, node.attrib.get(
'{%s}text' % WriteTexNS, '').decode('string-escape')
print(node.attrib.get(
'{%s}text' % WriteTexNS, '').decode('string-escape'), file=sys.stderr)
return
print >>sys.stderr, "No text find."
print("No text find.", file=sys.stderr)
return
else:
if action == "new":
Expand All @@ -104,7 +104,7 @@ def effect(self):
f.close()

if self.text == "":
print >>sys.stderr, "empty LaTeX input. Nothing is changed."
print("empty LaTeX input. Nothing is changed.", file=sys.stderr)
return

tmp_dir = tempfile.mkdtemp("", "writetex-")
Expand Down Expand Up @@ -154,8 +154,8 @@ def effect(self):
tmp_dir=tmp_dir, tex_file=tex_file, out_file=out_file), shell=True)

if not os.path.exists(pdf_file):
print >>sys.stderr, "Latex error: check your latex file and preamble."
print >>sys.stderr, open(log_file).read()
print("Latex error: check your latex file and preamble.",file=sys.stderr)
print(open(log_file).read(),file=sys.stderr)
return
else:
if self.options.pdftosvg == '1':
Expand Down Expand Up @@ -344,4 +344,4 @@ def parse_transform(transf):

if __name__ == '__main__':
e = WriteTex()
e.affect()
e.affect()

0 comments on commit ac1105f

Please sign in to comment.