From 3f47eb1883907f99b5e62e9082c3bb56d4da201a Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 5 Nov 2010 16:59:27 +0000 Subject: [PATCH] More documentation. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36127 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/parser_tools.py | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py index 6cc5c35e9c..9a01514ef8 100644 --- a/lib/lyx2lyx/parser_tools.py +++ b/lib/lyx2lyx/parser_tools.py @@ -68,6 +68,69 @@ get_quoted_value(lines, token, start[, end[, default]): del_token(lines, token, start[, end]): Like find_token, but deletes the line if it finds one. Returns True if a line got deleted, otherwise False. + +find_beginning_of(lines, i, start_token, end_token): + Here, start_token and end_token are meant to be a matching + pair, like "\begin_layout" and "\end_layout". We look for + the start_token that pairs with the end_token that occurs + on or after line i. Returns -1 if not found. + So, in the layout case, this would find the \begin_layout + for the layout line i is in. + Example: + ec = find_token(document.body, "