]> git.lyx.org Git - lyx.git/commitdiff
Preparation to support translations with python3
authorKornel Benko <kornel@lyx.org>
Wed, 11 Mar 2015 19:54:28 +0000 (20:54 +0100)
committerKornel Benko <kornel@lyx.org>
Wed, 11 Mar 2015 19:54:28 +0000 (20:54 +0100)
Thanks to José.

development/cmake/doc/ReplaceValues.py
development/cmake/po/cat.py
development/cmake/po/dos2unix.py

index a25972c59da520551698a1b908183646444e170a..f07ce80bc9b3953a549848ec166fd3f6b6c7be0f 100755 (executable)
@@ -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]))
 
 ##########################################
 
index be8f4b2e9063fe7855d51cede8ba1bca0bc3a53d..02655dc5646585efce0af3165890cb1fd4bd3244 100644 (file)
@@ -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
index 1ba822b4c6fb56bc62f2f863c0491f84c07cb661..a5b6431429e5f21788de96b5ddf394873498ca0b 100644 (file)
@@ -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()