From 17175159c7020bca50b240d04b3827fa40cd7e26 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 4 Nov 2010 16:25:26 +0000 Subject: [PATCH] Little things in some of my routines. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36074 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/lyx_2_0.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/lyx2lyx/lyx_2_0.py b/lib/lyx2lyx/lyx_2_0.py index 1a7a266193..3f6f6742fc 100644 --- a/lib/lyx2lyx/lyx_2_0.py +++ b/lib/lyx2lyx/lyx_2_0.py @@ -1300,7 +1300,6 @@ def revert_math_scale(document): def revert_pagesizes(document): - i = 0 " Revert page sizes to default " i = find_token(document.header, '\\papersize', 0) if i != -1: @@ -1314,7 +1313,6 @@ def revert_pagesizes(document): def revert_DIN_C_pagesizes(document): - i = 0 " Revert DIN C page sizes to default " i = find_token(document.header, '\\papersize', 0) if i != -1: @@ -1333,7 +1331,7 @@ def convert_html_quotes(document): line = document.header[i] l = re.compile(r'\\html_latex_start\s+"(.*)"') m = l.match(line) - if m != None: + if m: document.header[i] = "\\html_latex_start " + m.group(1) i = find_token(document.header, '\\html_latex_end', 0) @@ -1341,7 +1339,7 @@ def convert_html_quotes(document): line = document.header[i] l = re.compile(r'\\html_latex_end\s+"(.*)"') m = l.match(line) - if m != None: + if m: document.header[i] = "\\html_latex_end " + m.group(1) @@ -1353,14 +1351,22 @@ def revert_html_quotes(document): line = document.header[i] l = re.compile(r'\\html_latex_start\s+(.*)') m = l.match(line) - document.header[i] = "\\html_latex_start \"" + m.group(1) + "\"" + if not m: + document.warning("Weird html_latex_start line: " + line) + del document.header[i] + else: + document.header[i] = "\\html_latex_start \"" + m.group(1) + "\"" i = find_token(document.header, '\\html_latex_end', 0) if i != -1: line = document.header[i] l = re.compile(r'\\html_latex_end\s+(.*)') m = l.match(line) - document.header[i] = "\\html_latex_end \"" + m.group(1) + "\"" + if not m: + document.warning("Weird html_latex_end line: " + line) + del document.header[i] + else: + document.header[i] = "\\html_latex_end \"" + m.group(1) + "\"" def revert_output_sync(document): -- 2.39.5