]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/layout2layout.py
Forgot this bit from last commit.
[lyx.git] / lib / scripts / layout2layout.py
index e539714921f563db467d614472ebe36bc91588f9..e10bfc8118cd701dbe79f5011db6d5cfe2d0acf3 100644 (file)
@@ -9,11 +9,32 @@
 
 # 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
+
+# Incremented to format 8, 25 July 2008 by rgh
+# UseModule tag added to layout files
+# CopyStyle added to InsetLayout
+
+# Incremented to format 9, 5 October 2008 by rgh
+# ForcePlain and CustomPars tags added to InsetLayout
+
+currentFormat = 9
+
 
 def usage(prog_name):
     return ("Usage: %s inputfile outputfile\n" % prog_name +
@@ -135,10 +156,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 +176,11 @@ def convert(lines):
                 i += 1
             continue
 
+        # These just involved new features, not any changes to old ones
+        if format >= 5 and format <= 8:
+          i += 1
+          continue
+
         if format == 4:
             # Handle conversion to long CharStyle names
             match = re_CharStyle.match(lines[i])
@@ -396,7 +422,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)