4.4.0
Changes since 4.3.0
Breaking changes
-
Remove partial sorting support (obsolete feature)
- Remove
--sort-cache-size
flag in command line - (For library users) Remove
sortCacheSize
argument toglos.write
andglos.convert
- Remove
-
Re-design sorting and
sortKey
parameters-
Breaking change for library users, and user plugins that need sorting (
sortOnWrite = ALWAYS
) -
Change
glos.convert
- Replace argument
sortKey
(Callable) withsortKeyName
(str
) - Add argument
sortEncoding
(str) defaulting toutf-8
- Replace argument
-
Change
glos.write
- Replace argument
sortKey
(Callable) withnamedSortKey
(sort_keys.NamedSortKey
) - Add argument
sortEncoding
(str
) defaulting toutf-8
- Replace argument
-
Change
glos.sortWords
- Replace argument
key
(Callable) withsortKeyName
(str
) - Add argument
sortEncoding
(str
) defaulting toutf-8
- Replace argument
-
Change API of plugins that use
sortOnWrite = ALWAYS
- Replace
writer.sortKey
andWriter.sqliteSortKey
withsortKeyName
in plugin module. - See the stardict.py for example.
- Replace
Note 1: All
sortKey
andsortEncoding
arguments are optional.Note 2: Values of
sortKeyName
are documented in doc/sort-key.md -
-
Rename 2 files in
doc/
:- Rename
doc/entry_filters.md
todoc/entry-filters.md
- Rename
doc/term_colors.md
todoc/term-colors.md
- Rename
Features
-
--sort-key
and--sort-encoding
command line flags (as part of above re-design)- See README.md and doc/sort-key.md.
-
Now SQLite mode works for all output formats.
Bug fixes
- Fix lack of Progress Bar while writing in indirect or SQLite mode
- Fix misleading message log about SQLite mode
- Fix unclosed files in XDXF and FreeDict plugins
Improvements
- Show a 1-line log instead of
FileNotFoundError
traceback inglos.read
andglos.write
- Close readers in
glos.convert
ifwrite
failed - Fix some type annotations and comments
- (For library users) Change
Glossary.__str__
- (For library users)
glos.setInfo
: convert non-str value to str, and add tests
Unit testing
Add new tests and improve existing tests.
- Coverage of
glossary.py
: %89 - Overall coverage of codebase + plugins: %58
Refactoring and design improvements
- Simplify by passing
glos
object toEntryList()
- Replace
SqList
withSqEntryList
- Change
__iter__
ofSqEntryList
andEntryList
to give entry objects - Simplify
Glossary
by movinggc.collect
toEntryList
andSqEntryList
- Remove unused function
xml_unescape
- Remove unused import from FreeDict and JMDict plugins
- Use
operator.itemgetter
instardict.py
,dict_cc.py
,ebook_kobo.py
,reverse.py
glossary.py
: cleanup, simplify and optimize generators logic- Also remove
index
argument fromentryFilter.run
method and add some comments
- Also remove
- Remove redundant check in
glos.progress
- Remove redundant check in
_getLangByStr
- Remove redundant check in
Glossary.detectOutputFormat