From c27dce2b1670cfc3c2ebfe86a8d63ee116b9372d Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sat, 24 Mar 2007 12:39:45 +0000 Subject: [PATCH] support direct conversion from format 1 to format 3 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17531 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/scripts/layout2layout.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py index 45bc499f8b..80fe6906e7 100644 --- a/lib/scripts/layout2layout.py +++ b/lib/scripts/layout2layout.py @@ -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