--- /dev/null
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# file updatelayouts.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 all layout files to current format
+# The old files are backuped with extension ".old"
+
+
+import os, re, string, sys, subprocess, tempfile, shutil
+
+sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), "../../lib/scripts"))
+from layout2layout import main as layout2layout
+
+def main(argv):
+
+ toolsdir = os.path.dirname(argv[0])
+ layoutdir = os.path.join(toolsdir, '../../lib/layouts')
+ os.chdir(layoutdir)
+ for i in os.listdir("."):
+ (base, ext) = os.path.splitext(i)
+ if ext == ".old":
+ continue
+ args = ["layout2layout", i + ".old", i]
+ shutil.copy(args[2], args[1])
+ layout2layout(args)
+
+ return 0
+
+
+if __name__ == "__main__":
+ main(sys.argv)
+++ /dev/null
-#!/bin/bash
-
-# find out where we are relative to the program directory
-curdir=$(pwd);
-progloc=$0;
-pathto=${progloc%/*};
-# get us into development/tools
-if [ "$progloc" != "$pathto" ]; then
- if ! cd $pathto; then
- echo "Couldn't get to development/tools!";
- exit 1;
- fi
-fi
-
-if ! cd ../../lib/layouts/; then
- echo "Couldn't get to lib/layouts!";
- exit 1;
-fi
-
-for i in *; do
- cp $i $i.old;
- python ../scripts/layout2layout.py <$i.old >$i;
-done
# Manual (section "Declaring a new text class").
# You might also want to consider running the
-# development/tools/updatelayouts.sh script to update all
+# development/tools/updatelayouts.py script to update all
# layout files to the new format.
currentFormat = 51
// LayoutFile.cpp. Additions will never do so, but syntax changes
// could. See LayoutFileList::addEmptyClass() and, especially, the
// definition of the layoutpost string.
-// You should also run (or ask someone who has bash to run) the
-// development/tools/updatelayouts.sh script, to update the format of
-// all of our layout files.
+// You should also run the development/tools/updatelayouts.py script,
+// to update the format of all of our layout files.
//
int const LAYOUT_FORMAT = 51; //spitz: add ToggleIndent tag