import unicodedata
import sys, os
-from parser_tools import find_token, find_end_of, find_tokens, get_value, get_value_string
+from parser_tools import find_token, find_end_of, find_tokens, \
+ find_end_of_inset, find_end_of_layout, get_value, get_value_string
####################################################################
# Private helper functions
return True
-def find_end_of_inset(lines, i):
- " Find end of inset, where lines[i] is included."
- return find_end_of(lines, i, "\\begin_inset", "\\end_inset")
-
-
-def find_end_of_layout(lines, i):
- " Find end of layout, where lines[i] is included."
- return find_end_of(lines, i, "\\begin_layout", "\\end_layout")
-
-
# Note that text can be either a list of lines or a single line.
def add_to_preamble(document, text):
""" Add text to the preamble if it is not already there.
if is_nonempty_line(lines[i]):
return i
return -1
+
+
+def find_end_of_inset(lines, i):
+ " Find end of inset, where lines[i] is included."
+ return find_end_of(lines, i, "\\begin_inset", "\\end_inset")
+
+
+def find_end_of_layout(lines, i):
+ " Find end of layout, where lines[i] is included."
+ return find_end_of(lines, i, "\\begin_layout", "\\end_layout")