if i == -1:
document.warning("Malformed LyX document: Missing \\use_indices.")
return
- indices = get_value(document.header, "\\use_indices", i)
- useindices = (indices == "true")
+ useindices = str2bool(get_value(document.header, "\\use_indices", i))
i = 0
while True:
i = find_token(document.body, "\\begin_inset CommandInset index_print", i)
if i == -1:
document.warning("Malformed LyX document: Missing \\use_indices.")
return
- indices = get_value(document.header, "\\use_indices", i)
- useindices = (indices == "true")
+ useindices = str2bool(get_value(document.header, "\\use_indices", i))
i = 0
while True:
i = find_token(document.body, "\\begin_inset CommandInset index_print", i)
return
# remove the preamble line and write to the preamble
# when suppress_date was true
- date = get_value(document.header, "\\suppress_date", i)
- if date == "true":
+ date = str2bool(get_value(document.header, "\\suppress_date", i))
+ if date:
add_to_preamble(document, ["% this command was inserted by lyx2lyx"])
add_to_preamble(document, ["\\date{}"])
del document.header[i]
m = rgx.match(document.header[i])
newval = "0" # MathML
if m:
- val = m.group(1)
- if val != "true":
+ val = str2bool(m.group(1))
+ if not val:
newval = "2" # Images
else:
document.warning("Can't match " + document.header[i])