]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/lyx_1_1_6.py
Whitespace, only whitespace. s/ +$//
[lyx.git] / lib / lyx2lyx / lyx_1_1_6.py
index ce043abcc611481ae318cf8338d57d80c6926e0c..67b114a0b626c88cf3c58ea13e971d0c88dfc574 100644 (file)
@@ -22,7 +22,8 @@ from parser_tools import find_re, find_tokens, find_token, check_token
 
 
 lyxtable_re = re.compile(r".*\\LyXTable$")
-def update_tabular(lines, opt):
+def update_tabular(file):
+    lines = file.body
     i=0
     while 1:
         i = find_re(lines, lyxtable_re, i)
@@ -105,7 +106,7 @@ def update_tabular(lines, opt):
                     end = find_token(lines, '\\newline', i)
 
                 if end == -1:
-                    opt.error("Malformed LyX file.")
+                    file.error("Malformed LyX file.")
 
                 end = end - i
                 while end > 0:
@@ -262,7 +263,8 @@ def set_paragraph_properties(lines, prop_dict):
     return result[:]
 
 
-def update_language(header):
+def update_language(file):
+    header = file.header
     i = find_token(header, "\\language", 0)
     if i == -1:
         # no language, should emit a warning
@@ -274,14 +276,8 @@ def update_language(header):
     return
 
 
-def convert(header, body, opt):
-    update_tabular(body, opt)
-    update_language(header)
-    opt.format = 217
-
-
-def revert(header, body, opt):
-    opt.error("The convertion to an older format (%s) is not implemented." % opt.format)
+convert = [[217, [update_tabular, update_language]]]
+revert  = []
 
 
 if __name__ == "__main__":