X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Flyx2lyx%2Flyxconvert_217.py;h=b55bd7d0ae3d5cb45b6cae05e7b39f3e3b0c8d22;hb=cd6377fc2886e4be8e8f3a21fed6b23361dbea80;hp=2d52ef581581bada714405991db31778255d55da;hpb=3a8ef790c8802aa6dc6cf654aa8724a08ee1d89f;p=lyx.git diff --git a/lib/lyx2lyx/lyxconvert_217.py b/lib/lyx2lyx/lyxconvert_217.py index 2d52ef5815..b55bd7d0ae 100644 --- a/lib/lyx2lyx/lyxconvert_217.py +++ b/lib/lyx2lyx/lyxconvert_217.py @@ -18,11 +18,16 @@ import re, string, sys from parser_tools import * -bool_table = {"0": "false", "1":"true" } +def bool_table(item): + if item == "0": + return "false" + # should emit a warning if item != "1" + return "true" + align_table = {"0": "top", "2": "left", "4": "right", "8": "center"} use_table = {"0": "none", "1": "parbox"} -#table_meta_re = re.compile(r'') +table_meta_re = re.compile(r'') def update_tabular(lines): i=0 while 1: @@ -33,7 +38,10 @@ def update_tabular(lines): i = i +1 # scan table header meta-info - lines[i] = string.replace(lines[i], 'LyXTabular version="1"', 'lyxtabular version="2"') + res = table_meta_re.match( lines[i] ) + if res: + val = res.groups() + lines[i] = '' % val j = find_token(lines, '', i) + 1 if j == 0: @@ -44,17 +52,17 @@ def update_tabular(lines): lines[i:j] = new_table i = i + len(new_table) -col_re = re.compile(r'') -cell_re = re.compile(r'') -features_re = re.compile(r'') -row_re = re.compile(r'') +col_re = re.compile(r'') +cell_re = re.compile(r'') +features_re = re.compile(r'') +row_re = re.compile(r'') def table_update(lines): lines[1] = string.replace(lines[1], '