4.5.0
Changes since 4.4.1
Bug fixes
-
Fix 2 log messages in
glos._resolveConvertSortParams
-
Fixes and improvements in Dictfile (.df) reader
- Fix exception: disable loading info (Dicfile does not support info)
- TextGlossaryReader: prevent producing duplicate data entries
- This fixes:
error in DataEntry.save: [Errno 2] No such file or directory: ...
becauseentry.save()
moves the temp file to output path - This bug only existed for Dictfile (.df) format.
- This fixes:
- Remove extra colon, #358
- Remove some extra newline
- And add test for Dictfile to/from Tabfile
-
Fix not cleaning up temp directory on return with error from
glos.convert
Features
-
ui_gtk: add a "General Options" button that opens a dialog for:
- Settings for
sort
andsortKey
- Checkbox for SQLite mode
- Check boxes for config params:
save_info_json
,lower
,skip_resources
,rtl
,enable_alts
,cleanup
,remove_html_all
- Settings for
-
Add support for
--sort-key random
to shuffle entries
Performance improvements
-
Performance improvement: remove
gc.collect()
calls inGlossary
and*EntryList
- Not needed since Python 3.8
- Change minimum python requirement to 3.8 in
README.md
-
Do not import all plugin modules (only import two plugins that are used)
- Load json file
plugins-meta/index.json
instead - In debug mode, all plugin modules are still imported and validated
- User plugins are still imported
- Load json file
Other improvements
- Improve detection of languages from glossary name, and add tests
- Update
langs.json
: add new 3-letter codes for 25 languages glos.preventDuplicateWords
andglos.removeHtmlTagsAll
: prevent adding filter twiceglos.cleanup
: reset path list to avoid (non-critical) error if called again- Minor improvements in
Glossary.init()
DataEntry.save
: onFileNotFoundError
show a 1-line error instead oflog.exception
- ui_gtk: create a new
Glossary
object every time Convert button is clicked - Add docstring for
Glossary.init
Unit testing
- Update
tests/glossary_errors_test.py
- Add missing cleanup for some temp file
- add test for LDF to/from Tabfile
Refactoring
-
Plugins: replace import of
formats_common
from currect directory withpyglossary.plugins.formats_common
-
Fix
logging.warn
method is deprecated, usewarning
instead, PR #360 by @BoboTiG -
Fix
DeprecationWarning: invalid escape sequence
, PR #361 by @BoboTiG -
Move some functions from
glossary_utils.py
tocompression.py
-
Move some methods from
Glossary
to new parent classesPluginManager
andGlossaryInfo
-
Some refactoring in
plugin_prop.py
andplugin_manager.py
- Rename
plugin.pluginModule
toplugin.module
- Minimize direct access to
plugin.module
,plugin.readerClass
orplugin.writerClass
- Add some new properties to
PluginProp
- Remove a log from
glossary.py
- Disable validation of plugins unless in debug mode
plugin_prop.py
: fix checking debug level
- Rename
-
sq_entry_list.py
: renamesortColumns
tosqliteSortKey
-
Some refactoring around
setSortKey
betweenGlossary
,EntryList
andSqEntryList
-
Remove
Entry.sqliteSortKeyFrom
and related classmethods -
Some more simplification in
glossary.py
-
Remove
Entry.defaultSortKey
-
Some style fixes
-
iter_utils.py
: remove unusedkey=
argument fromunique_everseen
-
Refactor ui_gtk and update config comments
-
extractInlineHtmlImages
: avoid writing file within sub func