2 # -*- coding: utf-8 -*-
4 # file updatelayouts.py
5 # This file is part of LyX, the document processor.
6 # Licence details can be found in the file COPYING.
10 # Full author contact details are available in file CREDITS
12 # This script converts all layout files to current format
13 # The old files are backuped with extension ".old"
16 import os, re, string, sys, subprocess, tempfile, shutil
18 sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), "../../lib/scripts"))
19 from layout2layout import main as layout2layout
23 toolsdir = os.path.dirname(argv[0])
25 dirs.append(os.path.join(toolsdir, '../../lib/layouts'))
26 dirs.append(os.path.join(toolsdir, '../../lib/citeengines'))
27 for directory in dirs:
30 for i in os.listdir("."):
31 (base, ext) = os.path.splitext(i)
34 args = ["layout2layout", i + ".old", i]
35 shutil.copy(args[2], args[1])
42 if __name__ == "__main__":