lyx_mirror/development/cmake/po/dos2unix.py
Peter Kümmel bb53335350 cmake fix po generation/update: msguniq.exe doesn't like dos line endings (produces broken pot files)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39914 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-21 23:22:58 +00:00

17 lines
361 B
Python

#! /usr/bin/env python
###############
import sys
for fname in sys.argv[1:]:
infile = open( fname, "rb" )
instr = infile.read()
infile.close()
outstr = instr.replace( "\r\n", "\n" ).replace( "\r", "\n" )
if len(outstr) == len(instr):
continue
outfile = open( fname , "wb" )
outfile.write( outstr )
outfile.close()