mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Preparation to support translations with python3
Thanks to José.
This commit is contained in:
parent
58b3971eeb
commit
da46f6566a
@ -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]))
|
||||
|
||||
##########################################
|
||||
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
outfile.close()
|
||||
|
Loading…
Reference in New Issue
Block a user