diff --git a/development/Makefile.am b/development/Makefile.am index 22c09902f7..4c8314310f 100644 --- a/development/Makefile.am +++ b/development/Makefile.am @@ -17,7 +17,11 @@ tools/gen_lfuns.py \ tools/generate_symbols_images.lyx \ tools/generate_symbols_images.py \ tools/generate_symbols_list.py \ +tools/generate_symbols_svg.lyx \ +tools/generate_symbols_svg.py \ tools/unicodesymbols.py \ +tools/updatedocs.py \ +tools/updatelayouts.py \ tools/x-font \ tools/README \ tools/count_total_lines_of_compiled_code.sh \ diff --git a/development/tools/updatedocs.py b/development/tools/updatedocs.py new file mode 100644 index 0000000000..d2c7fe8c04 --- /dev/null +++ b/development/tools/updatedocs.py @@ -0,0 +1,54 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + +# file updatedocs.py +# This file is part of LyX, the document processor. +# Licence details can be found in the file COPYING. + +# author Georg Baum + +# Full author contact details are available in file CREDITS + +# This script converts documentation .lyx files to current format +# The old files are backuped with extension ".old" + + +import os, re, string, sys, subprocess, shutil + + +def convertdir(docdir, prefix, lyx2lyx): + olddir = os.getcwd() + os.chdir(docdir) + for i in os.listdir("."): + if os.path.isdir(i): + subdir = os.path.join(docdir, i) + subprefix = os.path.join(prefix, i) + convertdir(subdir, subprefix, lyx2lyx) + continue + (base, ext) = os.path.splitext(i) + if ext != ".lyx": + continue + old = i + ".old" + shutil.copy(i, old) + if sys.executable and sys.executable != '': + cmd = [sys.executable, lyx2lyx, old, '-o', i] + else: + # assume that python is in the path + cmd = [lyx2lyx, old, '-o', i] + sys.stderr.write('Converting %s\n' % os.path.join(prefix, i)) + subprocess.call(cmd) + os.chdir(olddir) + + +def main(argv): + + toolsdir = os.path.dirname(argv[0]) + docdir = os.path.abspath(os.path.join(toolsdir, '../../lib/doc')) + lyx2lyx = os.path.abspath(os.path.join(toolsdir, "../../lib/lyx2lyx/lyx2lyx")) + convertdir(docdir, '', lyx2lyx) + + return 0 + + +if __name__ == "__main__": + main(sys.argv)