From 7d58b1cdf0c341637f19c6610629bcec462f57a3 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 4 Nov 2010 16:30:17 +0000 Subject: [PATCH] These routines are no longer used. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36076 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/lyx_2_0.py | 92 ------------------------------------------ 1 file changed, 92 deletions(-) diff --git a/lib/lyx2lyx/lyx_2_0.py b/lib/lyx2lyx/lyx_2_0.py index 450a357a9f..8bde236395 100644 --- a/lib/lyx2lyx/lyx_2_0.py +++ b/lib/lyx2lyx/lyx_2_0.py @@ -1379,98 +1379,6 @@ def revert_output_sync(document): del document.header[i] -def convert_beamer_args(document): - " Convert ERT arguments in Beamer to InsetArguments " - - if document.textclass != "beamer" and document.textclass != "article-beamer": - return - - layouts = ("Block", "ExampleBlock", "AlertBlock") - for layout in layouts: - blay = 0 - while True: - blay = find_token(document.body, '\\begin_layout ' + layout, blay) - if blay == -1: - break - elay = find_end_of(document.body, blay, '\\begin_layout', '\\end_layout') - if elay == -1: - document.warning("Malformed LyX document: Can't find end of " + layout + " layout.") - blay += 1 - continue - bert = find_token(document.body, '\\begin_inset ERT', blay) - if bert == -1: - document.warning("Malformed Beamer LyX document: Can't find argument of " + layout + " layout.") - blay = elay + 1 - continue - eert = find_end_of_inset(document.body, bert) - if eert == -1: - document.warning("Malformed LyX document: Can't find end of ERT.") - blay = elay + 1 - continue - - # So the ERT inset begins at line k and goes to line l. We now wrap it in - # an argument inset. - # Do the end first, so as not to mess up the variables. - document.body[eert + 1:eert + 1] = ['', '\\end_layout', '', '\\end_inset', ''] - document.body[bert:bert] = ['\\begin_inset OptArg', 'status open', '', - '\\begin_layout Plain Layout'] - blay = elay + 9 - - -def revert_beamer_args(document): - " Revert Beamer arguments to ERT " - - if document.textclass != "beamer" and document.textclass != "article-beamer": - return - - layouts = ("Block", "ExampleBlock", "AlertBlock") - for layout in layouts: - blay = 0 - while True: - blay = find_token(document.body, '\\begin_layout ' + layout, blay) - if blay == -1: - break - elay = find_end_of(document.body, blay, '\\begin_layout', '\\end_layout') - if elay == -1: - document.warning("Malformed LyX document: Can't find end of " + layout + " layout.") - blay += 1 - continue - bopt = find_token(document.body, '\\begin_inset OptArg', blay) - if bopt == -1: - # it is legal not to have one of these - blay = elay + 1 - continue - eopt = find_end_of_inset(document.body, bopt) - if eopt == -1: - document.warning("Malformed LyX document: Can't find end of argument.") - blay = elay + 1 - continue - bplay = find_token(document.body, '\\begin_layout Plain Layout', blay) - if bplay == -1: - document.warning("Malformed LyX document: Can't find plain layout.") - blay = elay + 1 - continue - eplay = find_end_of(document.body, bplay, '\\begin_layout', '\\end_layout') - if eplay == -1: - document.warning("Malformed LyX document: Can't find end of plain layout.") - blay = elay + 1 - continue - # So the content of the argument inset goes from bplay + 1 to eplay - 1 - bcont = bplay + 1 - if bcont >= eplay: - # Hmm. - document.warning(str(bcont) + " " + str(eplay)) - blay = blay + 1 - continue - # we convert the content of the argument into pure LaTeX... - content = lyx2latex(document, document.body[bcont:eplay]) - strlist = put_cmd_in_ert(["{" + content + "}"]) - - # now replace the optional argument with the ERT - document.body[bopt:eopt + 1] = strlist - blay = blay + 1 - - def revert_align_decimal(document): l = 0 while True: -- 2.39.2