commit c92b481a448f0ebb1bc6725ce766aeb8364a747c
Author: José Matos <[email protected]>
Date: Mon Jun 10 12:05:03 2024 +0100
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.
---
lib/lyx2lyx/lyx_2_3.py | 47 +++++++++++++++++++++++++++-----------
lib/lyx2lyx/lyx_2_4.py | 61 ++++++++++++++++++++++++++++++--------------------
lib/lyx2lyx/lyx_2_5.py | 19 ++++++++++------
3 files changed, 83 insertions(+), 44 deletions(-)
diff --git a/lib/lyx2lyx/lyx_2_3.py b/lib/lyx2lyx/lyx_2_3.py
index 1991bb05b3..9bb34d802c 100644
--- a/lib/lyx2lyx/lyx_2_3.py
+++ b/lib/lyx2lyx/lyx_2_3.py
@@ -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 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 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
+)
####################################################################
# Private helper functions
diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index 2c8f562ca1..50f74678eb 100644
--- a/lib/lyx2lyx/lyx_2_4.py
+++ b/lib/lyx2lyx/lyx_2_4.py
@@ -17,30 +17,43 @@
""" Convert files to the file format generated by lyx 2.4"""
-import re, string
-import unicodedata
-import sys, os
-
-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)
-# 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
+import re
+
+from datetime import (
+ datetime,
+ date,
+ time
+)
+
+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 lyx2lyx_tools import (
+ add_to_preamble,
+ insert_to_preamble,
+ lyx2latex,
+ put_cmd_in_ert,
+ revert_language,
+ revert_flex_inset,
+ str2bool
+)
####################################################################
# Private helper functions
diff --git a/lib/lyx2lyx/lyx_2_5.py b/lib/lyx2lyx/lyx_2_5.py
index e0b67ea997..f41b902836 100644
--- a/lib/lyx2lyx/lyx_2_5.py
+++ b/lib/lyx2lyx/lyx_2_5.py
@@ -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,
--
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs