]> git.lyx.org Git - features.git/commitdiff
support direct conversion from format 1 to format 3
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sat, 24 Mar 2007 12:39:45 +0000 (12:39 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sat, 24 Mar 2007 12:39:45 +0000 (12:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17531 a592a061-630c-0410-9148-cb99ea01b6c8

lib/scripts/layout2layout.py

index 45bc499f8bd3b295623e1e4de3a343141211bdb1..80fe6906e77d66b9d2c3b095339d0f3f48a6ea3b 100644 (file)
@@ -138,11 +138,11 @@ def convert(lines):
                             only_comment = 0
                         elif format == 3:
                                 # nothing to do
-                                return
+                                return format
                         else:
                             error('Cannot convert file format %s' % format)
                 else:
-                        lines.insert(i, "Format 3")
+                        lines.insert(i, "Format 2")
                         only_comment = 0
                         continue
 
@@ -352,6 +352,8 @@ def convert(lines):
 
         i = i + 1
 
+    return format + 1
+
 
 def main(argv):
 
@@ -367,7 +369,9 @@ def main(argv):
 
     # Do the real work
     lines = read(input)
-    convert(lines)
+    format = 1
+    while (format < 3):
+        format = convert(lines)
     write(output, lines)
 
     # Close files