commit da46f6566a50c5ab2962952a9a813eca1be12e9e
Author: Kornel Benko <[email protected]>
Date:   Wed Mar 11 20:54:28 2015 +0100

    Preparation to support translations with python3
    
    Thanks to José.

diff --git a/development/cmake/doc/ReplaceValues.py 
b/development/cmake/doc/ReplaceValues.py
index a25972c..f07ce80 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 be8f4b2..02655dc 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 1ba822b..a5b6431 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()

Reply via email to