cmake/modules/ProjectSourceGroup.cmake \
cmake/pcheaders.h \
cmake/po/cat.py \
-cmake/po/dos2unix.py \
cmake/po/unix2dos.py \
cmake/post_install/CMakeLists.txt \
cmake/scripts/LyXCreateImagesResource.cmake \
out = sys.stdout
if outfile:
- out = open(outfile, "w")
+ # always write unix line endings, even on windows
+ out = open(outfile, "wb")
for f in args:
- fil = open(f, "r")
+ # accept both windows and unix line endings, since it can happen that we
+ # are on unix, but the file has been written on windows or vice versa.
+ fil = open(f, "rU")
for l in fil:
+ # this does always write unix line endings since the file has
+ # been opened in binary mode. This is needed since both gettext
+ # and our .pot file manipulation scripts assume unix line ends.
out.write(l)
fil.close()
+++ /dev/null
-#! /usr/bin/env python
-
-###############
-import sys
-
-for fname in sys.argv[1:]:
- infile = open( fname, "r" )
- instr = infile.read()
- infile.close()
- outstr = instr.replace( "\r\n", "\n" ).replace( "\r", "\n" )
-
- if outstr == instr:
- continue
-
- outfile = open( fname , "w" )
- outfile.write( outstr )
- outfile.close()
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat.pot"
COMMAND ${LYX_PYTHON_EXECUTABLE}
ARGS "${TOP_CMAKE_PATH}/po/cat.py" ${_py_sources} > "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat_tmp.pot"
- COMMAND ${LYX_PYTHON_EXECUTABLE}
- ARGS "${TOP_CMAKE_PATH}/po/dos2unix.py" "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat_tmp.pot"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat_tmp.pot" "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat.pot"
DEPENDS ${_py_sources}