]> git.lyx.org Git - features.git/commitdiff
Fix layout2layout.
authorRichard Heck <rgheck@comcast.net>
Thu, 10 Jan 2008 03:59:39 +0000 (03:59 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 10 Jan 2008 03:59:39 +0000 (03:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22459 a592a061-630c-0410-9148-cb99ea01b6c8

lib/scripts/layout2layout.py

index e539714921f563db467d614472ebe36bc91588f9..af50d3bab5a8c703776c8bc91e67354635228209 100644 (file)
@@ -9,12 +9,15 @@
 
 # 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
 
 
+currentFormat = 6
+
+
 def usage(prog_name):
     return ("Usage: %s inputfile outputfile\n" % prog_name +
             "or     %s <inputfile >outputfile" % prog_name)
@@ -135,10 +138,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 +158,10 @@ def convert(lines):
                 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 +403,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)