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)
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:
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
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__":