From c7cb2f251b2b6a403911eb93df805c637b8827c3 Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 2 Jun 2003 14:16:17 +0000 Subject: [PATCH] lyx2lyx changes for removing insetparent git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7083 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 4 ++++ lib/lyx2lyx/lyxconvert_221.py | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/ChangeLog b/lib/ChangeLog index 046b95673a..671df5883e 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2003-06-02 John Levon + + * lyx2lyx/lyxconvert_221.py: remove insetparents + 2003-06-01 Angus Leeming * configure.m4: add an extension to the dateout format or the converter diff --git a/lib/lyx2lyx/lyxconvert_221.py b/lib/lyx2lyx/lyxconvert_221.py index 14ade384ac..bf4e76edcf 100644 --- a/lib/lyx2lyx/lyxconvert_221.py +++ b/lib/lyx2lyx/lyxconvert_221.py @@ -16,6 +16,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import string +from parser_tools import find_token def add_end(header): header.append("\\end_header"); @@ -29,10 +30,19 @@ def convert_bibtex(lines): lines[i] = string.replace(lines[i],"\\begin_inset LatexCommand \\BibTeX", "\\begin_inset LatexCommand \\bibtex") +def remove_insetparent(lines): + i = 0 + while 1: + i = find_token(lines, "\\begin_inset LatexCommand \\lyxparent", i) + if i == -1: + break + del lines[i:i+3] + def convert(header, body): add_end(header) convert_spaces(body) convert_bibtex(body) + remove_insetparent(body) if __name__ == "__main__": pass -- 2.39.2