X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Flyx2lyx%2Flyx_1_1_6_3.py;h=f0be612103b2d940ea87044b27256827dc27bbed;hb=9fd8a869616cad617d0db8b022119c35855ea39d;hp=f7656d796adaf2cbbd1def62b2b6049729d8b1af;hpb=ddc31f7aeefb87901e11506f5448d68d5f462c3a;p=lyx.git diff --git a/lib/lyx2lyx/lyx_1_1_6_3.py b/lib/lyx2lyx/lyx_1_1_6_3.py index f7656d796a..f0be612103 100644 --- a/lib/lyx2lyx/lyx_1_1_6_3.py +++ b/lib/lyx2lyx/lyx_1_1_6_3.py @@ -1,6 +1,6 @@ # This file is part of lyx2lyx -# -*- coding: iso-8859-1 -*- -# Copyright (C) 2002-2004 José Matos +# -*- coding: utf-8 -*- +# Copyright (C) 2002-2004 José Matos # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -16,11 +16,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +""" Convert files to the file format generated by lyx 1.1.6, fix3 and fix4""" + import re -import string from parser_tools import find_token, find_re def bool_table(item): + " Convert 0, 1 to false, true." if item == "0": return "false" # should emit a warning if item != "1" @@ -32,9 +34,10 @@ align_table = {"0": "top", "2": "left", "4": "right", "8": "center"} use_table = {"0": "none", "1": "parbox"} table_meta_re = re.compile(r'') -def update_tabular(file): +def update_tabular(document): + " Update tabular format to version 2 (xml like syntax)." regexp = re.compile(r'^\\begin_inset\s+Tabular') - lines = file.body + lines = document.body i=0 while 1: i = find_re(lines, regexp, i) @@ -51,7 +54,7 @@ def update_tabular(file): j = find_token(lines, '', i) + 1 if j == 0: - file.warning( "Error: Bad lyx format i=%d j=%d" % (i,j)) + document.warning( "Error: Bad lyx format i=%d j=%d" % (i,j)) break new_table = table_update(lines[i:j]) @@ -65,7 +68,8 @@ features_re = re.compile(r'') def table_update(lines): - lines[1] = string.replace(lines[1], '