]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/layout2layout.py
* lib/scripts/TeXFiles.py:
[lyx.git] / lib / scripts / layout2layout.py
index e539714921f563db467d614472ebe36bc91588f9..e628a300fdfd5bf3b837d5b0bfea7e91c46c5d95 100644 (file)
@@ -9,11 +9,24 @@
 
 # Full author contact details are available in file CREDITS
 
-# This script will update a .layout file to format 3
+# This script will update a .layout file to format 6
 
 
 import os, re, string, sys
 
+# Incremented to format 4, 6 April 2007, lasgouttes
+# Introduction of generic "Provides" declaration
+
+# Incremented to format 5, 22 August 2007 by vermeer
+# InsetLayout material
+
+# Incremented to format 6, 7 January 2008 by spitz
+# Requires tag added to layout files
+
+# Incremented to format 7, 24 March 2008 by rgh
+# AddToPreamble tag added to layout files
+currentFormat = 7
+
 
 def usage(prog_name):
     return ("Usage: %s inputfile outputfile\n" % prog_name +
@@ -135,10 +148,10 @@ def convert(lines):
                 match = re_Format.match(lines[i])
                 if match:
                         format = int(match.group(4))
-                        if format > 1 and format < 5:
+                        if format > 1 and format < currentFormat:
                             lines[i] = "Format %d" % (format + 1)
                             only_comment = 0
-                        elif format == 5:
+                        elif format == currentFormat:
                                 # nothing to do
                                 return format
                         else:
@@ -155,6 +168,14 @@ def convert(lines):
                 i += 1
             continue
 
+        if format == 6:
+          i += 1
+          continue
+
+        if format == 5:
+          i += 1
+          continue
+
         if format == 4:
             # Handle conversion to long CharStyle names
             match = re_CharStyle.match(lines[i])
@@ -396,7 +417,7 @@ def main(argv):
     # Do the real work
     lines = read(input)
     format = 1
-    while (format < 4):
+    while (format < currentFormat):
         format = convert(lines)
     write(output, lines)