4.1.0
There are a lot of changes since last release, but here is what I could gather and organize!
Please see the commit list for more!
-
Improvements in ui_gtk
-
Improvements in ui_tk
-
Improvements in ui_cmd_interactive
-
Refactoring and improvements in ui-related codebase
-
Fix not loading config with
--ui=none
-
Code style fixes and cleanup
-
Documentation
- Update most documentations.
- Add comments for read/write options.
- Generate documentation for all formats
- Placed in doc/p, linked to in
README.md
- Generating with
scripts/plugin-doc-gen.py
script - Read list of dictionary tools/applicatios from TOML files in plugins-meta/tools
- Placed in doc/p, linked to in
-
Add
Dockerfile
andrun-with-docker.sh
script -
New command-line flags:
--json-read-options
and--json-write-options
- To allow using
;
in option values - Example:
'--json-write-options={"delimiter": ";"}'
- To allow using
--gtk
,--tk
and--cmd
as shortcut for--ui=gtk
etc--rtl
to change direction of definitions, #268, also added toconfig.json
-
Fix non-working
--remove-html
flag -
Changes in
Glossary
class- Rename
glos.getPref
toglos.getConfig
- Change
formatsReadOptions
andformatsWriteOptions
toDict[str, OrderedDict[str, Any]]
- to include default values
- remove
glos.writeTabfile
, replace with a func inpyglossary/text_writer.py
Glossary.init
: avoid showing error if user plugin directory does not exist
- Rename
-
Fixes and improvements code base
- Prevent
dataEntry.save()
from raising exception because of invalid filename or permission - Avoid exception if removing temp file/folder failed
- Avoid
mktemp
and more improvements- use
~/.cache/pyglossary/
directory instead of/tmp/
- use
- Fixes and improvements in
runDictzip
- Raise
RuntimeError
instead ofStopIteration
when iterating over a non-open reader - Avoid exception if no zip command was found, fix #294
- Remove directory after creating .zip, and some refactoring, #294
DataEntry
: replaceinTmp
argument withtmpPath
argumentEntry
: fix html pattern for hyperlinks, #330- Fix incorrect virutal env directory detection
- Refactor
dataDir
detection, #307 #316 - Show warning if failed to create user plugins directory
- fix possible exception in
log.emit
- Add support for Conda in
dataDir
detection, #321 - Fix f-string in
StdLogHandler.emit
- Prevent
-
Fixes and improvements in Windows
-
Changes in Config:
- Rename config key
skipResources
toskip_resources
- Add it to config.json and configDefDict
- Rename config key
utf8Check
toutf8_check
- User should edit ~/.pyglossary/config.json manually
- Rename config key
-
Implement direct compression and uncompression, and some refactoring
- change glos.detectInputFormat to return (filename, format, compression) or None
- remove Glossary.formatsReadFileObj and Glossary.formatsWriteFileObj
- remove
fileObj=
argument fromglos.writeTxt
- use optional 'compressions' list/tuple from Writer or Reader classes for direct compression/uncompression
- refactoring in glossary_utils.py
-
Update
setup.py
-
Show version from 'git describe --always' on
--version
-
FileSize
option (used in many formats):- Switch to metric (powers of 1000) for
K
,M
,G
units - Add
KiB
,MiB
,GiB
for powers of 1024
- Switch to metric (powers of 1000) for
-
Add
extensionCreate
variable (str) to plugins and plugin API- Use it to improve ui_tk
-
Text-based glossary code-base (effecting Tabfile, Kobo Dictfile, LDF)
- Optimize TextGlossaryReader
- Change multi-file text glossary file names from
.N.txt
to.txt.N
(whereN>=1
) - Enable reading pyglossary-writen multi-file text glossary by adding
file_count=-1
to metadata- because the number of files is not known when creating the first txt file
-
Tabfile
- Rename option
writeInfo
toenable_info
- Reader: read resource files from
*.txt_res
directory if exists - Add
*.txt_res
directory to *.zip file
- Rename option
-
Zim Reader:
- Migrate to libzim 1.0
- Add mimetype
image/webp
, fix #329
-
Slob and Tabfile Writer: add
file_size_approx
option to allow writing multi-part output- support values like:
5500k
,100m
,1.2g
- support values like:
-
Add
word_title=False
option to some writers- Slob Writer: add
word_title=False
option - Tabfile Writer: add
word_title=False
option - CSV Writer: add
word_title=False
option - JSON Writer: add
word_title=False
option - Dict.cc Reader: do not add word title
- FreeDict Reader: rename
keywords_header
option toword_title
- Add
glos.wordTitleStr
, used in plugins withword_title
option - Add
definition_has_headwords=True
info key to avoid adding the title next time we read the glossary
- Slob Writer: add
-
Aard2 (slob)
- Writer: add option
separate_alternates=False
, #270 - Writer: fix handling
content_type
option - Writer: use
~/.cache/pyglossary/
instead of/tmp
- Writer: add mp3 to mime types, #289
- Writer: add support for .ini data file, #289
- Writer: support .webp files, #329
- Writer: supoort .tiff and .tif files
- Reader: read glossary name/title and creation time from tags
- Reader: extract all metedata / tags
slob.py
library: Refactoring and cleanup
- Writer: add option
-
StarDict:
-
FreeDict Reader
- Fix two slashes before and after
pron
- Avoid running
unescape_unicode
byencoding="utf-8"
arg toET.htmlfile
- Fix exception if
edition
is missing in header, and few other fixes - Support
<cit type="example">
with<cit type="trans">
inside it - Support
<cit type="trans">
inside nested second-level(nested)<sense>
- Add
"lang"
attribute to html elements - Add option "example_padding"
- Fix rendering
<def>
, refactoring and improvement - Handle
<note>
inside<sense>
- Support
<note>
in<gramGrp>
- Mark external refs with
<a ... class="external">
- Support comment in
<cit>
- Support
<xr>
inside<sense>
- Implement many tags under
<sense>
- Improvements and refactoring
- Fix two slashes before and after
-
XDXF
-
Fix not finding
xdxf.xsl
in installed mode- Effecting XDXF and StarDict formats
-
xdxf.xsl
: generate<font color=...>
instead of<span style=...>
-
StarDict Reader: Add
xdxf_to_html=True
option, #258 -
StarDict Reader: Import
xdxf_transform
lazily- Remove forced dependency to
lxml
, #261
- Remove forced dependency to
-
XDXF plugin: fix glos.setDefaultDefiFormat call
xdxf_transform.py
: remove warnings for , #322
- Merge PR #317
- Parse
sr
,gr
,ex_orig
,ex_transl
tags andaudio
- Remove
None
attribute fromaudio
tag - Use unicode symbols for audio and external link
- Use another speaker symbol for audio
- Add audio controls
- Use plain link without an audio tag
- Parse
-
-
Mobi
-
Changes in
ebook_base.py
(Mobi and EPUB)- Avoid exception if removing tmpDir failed
- Use
style.css
dataEntry, #299
-
DSL Reader:
-
AppleDict Source
- Change path of Dictionary Development Kit, #300
- Open all text files with
encoding="utf-8"
- Some refactporing
- Rename 4 options:
- cleanHTML -> clean_html
- defaultPrefs -> default_prefs
- prefsHTML -> prefs_html
- frontBackMatter -> front_back_matter
-
AppleDict Binary
-
Octopus MDict (MDX)
-
DICT.org plugin:
installToDictd
: skip if target directory does not exist- Make rendering dictd files a bit clear in pure txt
- Fix indention issue and add bword prefix as url
-
Fixes and improvements in Dict.cc (SQLite3) plugin:
-
JMDict
- Support reading compressed file directly
- Show pos before gloss (translations)
- Avoid running
unescape_unicode
-
DigitalNK: work around Python's sqlite bug, #282
-
Changes in
dict_org.py
plugin, By Justin Yang- Use
to replace newline - Replace words with {} around to true web link
- Use
-
CC-CEDICT Reader:
- Fix import error in
conv.py
- Switch from jinja2 to lxml
- Fix not escaping
<
,>
and&
- Note: lxml inserts
 
instead of
- Fix not escaping
- Use
<font>
instead of<span style=...>
- add option to use Traditional Chinese for entry name
- Fix import error in
-
Rename read/write options:
- DSL: rename option onlyFixMarkUp to only_fix_markup
- SQL: rename 2 options:
infoKeys
->info_keys
addExtraInfo
->add_extra_info
- EDLIN: rename option
havePrevLink
toprev_link
- CSV: rename option
writeInfo
toenable_info
- JSON: rename option
writeInfo
toenable_info
- BGL: rename all read/write options (to cameCase to snake_case)
-
New formats:
-
Remove TreeDict plugin,
plugins/treedict.py
-
Remove FreeDict writer