]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/prefs2prefs.py
* layouttranslations.review - review of all langs.
[lyx.git] / lib / scripts / prefs2prefs.py
index b29bb74528b773196bf51d14e8f7e66dc4e3a1be..f98b6e833ec4c6b2f9c0522fa8d31fb80717083a 100644 (file)
@@ -1,4 +1,3 @@
-#! /usr/bin/env python
 # -*- coding: utf-8 -*-
 
 # file prefs2prefs.py
@@ -167,17 +166,24 @@ def main(argv):
        format = get_format(lines)
 
        while format < current_format:
-               for c in conversions[format]:
+               target_format, convert = conversions[format]
+               old_format = format
+
+               # make sure the conversion list is sequential
+               if int(old_format) + 1 != target_format:
+                       sys.stderr.write("Something is wrong with the conversion chain.\n")
+                       sys.exit(1)
+
+               for c in convert:
                        for i in range(len(lines)):
                                (update, newline) = c(lines[i])
                                if update:
                                        lines[i] = newline
 
                update_format(lines)
+               format = get_format(lines)
 
                # sanity check
-               old_format = format
-               format = get_format(lines)
                if int(old_format) + 1 != int(format):
                        sys.stderr.write("Failed to convert to new format!\n")
                        sys.exit(1)