Use insert_document_option to remove Georgian when reverting.

Less code for the same functionality. :-)
This commit is contained in:
José Matos 2018-04-28 18:47:32 +01:00
parent 08182ead14
commit 94905f9ce3

View File

@ -24,15 +24,8 @@ import sys, os
# Uncomment only what you need to import, please.
#from parser_tools import find_token, find_end_of, find_tokens, \
# find_token_exact, find_end_of_inset, find_end_of_layout, \
# find_token_backwards, is_in_inset, get_value, get_quoted_value, \
# del_token, check_token, get_option_value
from lyx2lyx_tools import (add_to_preamble, put_cmd_in_ert, get_ert,
lyx2latex, lyx2verbatim, length_in_bp, convert_info_insets)
# insert_to_preamble, latex_length, revert_flex_inset,
# revert_font_attrs, hex2ratio, str2bool
lyx2latex, lyx2verbatim, length_in_bp, convert_info_insets, insert_document_option)
from parser_tools import (check_token, del_complete_lines,
find_end_of_inset, find_end_of_layout, find_nonempty_line, find_re,
@ -865,12 +858,7 @@ def revert_georgian(document):
j = find_token(document.header, "\\language_package default", 0)
if j != -1:
document.header[j] = "\\language_package babel"
k = find_token(document.header, "\\options", 0)
if k != -1:
document.header[k] = document.header[k].replace("\\options", "\\options georgian,")
else:
l = find_token(document.header, "\\use_default_options", 0)
document.header.insert(l + 1, "\\options georgian")
insert_document_option(document, "georgian")
def revert_sigplan_doi(document):