Reformat imports for easier reading

This is in line with the current hints for better readability:

* one import per line;
* order the imports alphabetically to be easier to search;

Take the chance to remove unused imports.
This commit is contained in:
José Matos 2024-06-10 12:05:03 +01:00
parent aeee6b373e
commit c92b481a44
3 changed files with 79 additions and 40 deletions

View File

@ -17,22 +17,43 @@
""" Convert files to the file format generated by lyx 2.3"""
import re, string
import unicodedata
import sys, os
import re
# Uncomment only what you need to import, please.
from parser_tools import (del_token, del_value, del_complete_lines,
find_complete_lines, find_end_of, find_end_of_layout, find_end_of_inset,
find_re, find_substring, find_token, find_token_backwards, find_across_lines,
get_containing_inset, get_containing_layout, get_bool_value, get_value,
get_quoted_value, is_in_inset, set_bool_value)
# find_tokens, find_token_exact, check_token, get_option_value
from parser_tools import (
del_token,
del_value,
del_complete_lines,
find_complete_lines,
find_end_of,
find_end_of_layout,
find_end_of_inset,
find_re,
find_substring,
find_token,
find_token_backwards,
find_across_lines,
get_containing_inset,
get_containing_layout,
get_bool_value,
get_value,
get_quoted_value,
is_in_inset,
set_bool_value
)
from lyx2lyx_tools import (add_to_preamble, put_cmd_in_ert, revert_font_attrs,
insert_to_preamble, latex_length, is_document_option,
insert_document_option, remove_document_option, revert_language)
from lyx2lyx_tools import (
add_to_preamble,
put_cmd_in_ert,
revert_font_attrs,
insert_to_preamble,
latex_length,
is_document_option,
insert_document_option,
remove_document_option,
revert_language
)
####################################################################
# Private helper functions

View File

@ -17,30 +17,43 @@
""" Convert files to the file format generated by lyx 2.4"""
import re, string
import unicodedata
import sys, os
import re
from datetime import (datetime, date, time)
from datetime import (
datetime,
date,
time
)
# Uncomment only what you need to import, please.
from parser_tools import (
count_pars_in_inset,
del_complete_lines,
del_token,
find_end_of,
find_end_of_inset,
find_end_of_layout,
find_token,
find_token_backwards,
find_token_exact,
find_re,
get_bool_value,
get_containing_inset,
get_containing_layout,
get_option_value,
get_value,
get_quoted_value,
is_in_inset
)
from parser_tools import (count_pars_in_inset, del_complete_lines, del_token,
find_end_of, find_end_of_inset, find_end_of_layout, find_token,
find_token_backwards, find_token_exact, find_re, get_bool_value,
get_containing_inset, get_containing_layout, get_option_value, get_value,
get_quoted_value, is_in_inset)
# del_value,
# find_complete_lines,
# find_re, find_substring,
# set_bool_value
# find_tokens, check_token
from lyx2lyx_tools import (put_cmd_in_ert, add_to_preamble, insert_to_preamble, lyx2latex,
revert_language, revert_flex_inset, str2bool)
# revert_font_attrs, latex_length
# get_ert, lyx2verbatim, length_in_bp, convert_info_insets
# revert_flex_inset, hex2ratio
from lyx2lyx_tools import (
add_to_preamble,
insert_to_preamble,
lyx2latex,
put_cmd_in_ert,
revert_language,
revert_flex_inset,
str2bool
)
####################################################################
# Private helper functions

View File

@ -17,16 +17,18 @@
""" Convert files to the file format generated by lyx 2.5"""
import re, string
import unicodedata
import sys, os
from datetime import (datetime, date, time)
import re
# Uncomment only what you need to import, please.
from parser_tools import (find_end_of_inset, find_end_of_layout, find_token, find_re, get_value)
from parser_tools import (
find_end_of_inset,
find_token,
find_re,
get_value
)
# count_pars_in_inset, del_complete_lines, del_token, find_end_of,
# find_end_of_layout,
# find_token_backwards, find_token_exact, get_bool_value,
# get_containing_inset, get_containing_layout, get_option_value,
# get_quoted_value, is_in_inset,
@ -36,7 +38,10 @@ from parser_tools import (find_end_of_inset, find_end_of_layout, find_token, fin
# set_bool_value
# find_tokens, check_token
from lyx2lyx_tools import (add_to_preamble, latex_length)
from lyx2lyx_tools import (
add_to_preamble,
latex_length
)
# put_cmd_in_ert, insert_to_preamble, lyx2latex,
# revert_language, revert_flex_inset, str2bool,
# revert_font_attrs,