From: Kornel Benko Date: Wed, 11 Mar 2015 19:54:28 +0000 (+0100) Subject: Preparation to support translations with python3 X-Git-Tag: 2.2.0alpha1~1208 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=da46f6566a50c5ab2962952a9a813eca1be12e9e;p=features.git Preparation to support translations with python3 Thanks to José. --- diff --git a/development/cmake/doc/ReplaceValues.py b/development/cmake/doc/ReplaceValues.py index a25972c59d..f07ce80bc9 100755 --- a/development/cmake/doc/ReplaceValues.py +++ b/development/cmake/doc/ReplaceValues.py @@ -1,5 +1,7 @@ #! /usr/bin/env python +from __future__ import print_function + # file ReplaceValues.py # # This file is part of LyX, the document processor. @@ -32,7 +34,7 @@ def SubstituteDataInLine(line): def SubstituteDataInFile(InFile): for line in open(InFile): - print SubstituteDataInLine(line[:-1]) + print(SubstituteDataInLine(line[:-1])) ########################################## diff --git a/development/cmake/po/cat.py b/development/cmake/po/cat.py index be8f4b2e90..02655dc564 100644 --- a/development/cmake/po/cat.py +++ b/development/cmake/po/cat.py @@ -1,5 +1,7 @@ #! /usr/bin/env python +from __future__ import print_function + import sys from getopt import getopt @@ -18,7 +20,7 @@ for (opt, param) in options: if opt == "-o": outfile = param elif opt == "-h": - print usage + print(usage) sys.exit(0) out = sys.stdout diff --git a/development/cmake/po/dos2unix.py b/development/cmake/po/dos2unix.py index 1ba822b4c6..a5b6431429 100644 --- a/development/cmake/po/dos2unix.py +++ b/development/cmake/po/dos2unix.py @@ -4,14 +4,14 @@ import sys for fname in sys.argv[1:]: - infile = open( fname, "rb" ) + infile = open( fname, "r" ) instr = infile.read() infile.close() outstr = instr.replace( "\r\n", "\n" ).replace( "\r", "\n" ) - if len(outstr) == len(instr): + if outstr == instr: continue - outfile = open( fname , "wb" ) + outfile = open( fname , "w" ) outfile.write( outstr ) - outfile.close() \ No newline at end of file + outfile.close()