We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: process stardict .syn.dz files as well. at the moment they need to be unpacked and saved as .syn files fist.
this works for me:
diff --git a/plugins/stardict.py index 31ba63b..de35933 100644 --- a/plugins/stardict.py +++ b/plugins/stardict.py @@ -334,12 +334,24 @@ class Reader(object): """ return synDict, a dict { entryIndex -> altList } """ - if not isfile(self._filename + ".syn"): - return {} + unicode_errors = self._unicode_errors - with open(self._filename + ".syn", "rb") as synFile: - synBytes = synFile.read() + synBytes = '' + if isfile(self._filename + ".syn.dz"): + with gzip.open(self._filename + ".syn.dz", mode="rb") as synFile: + synBytes = synFile.read() + if isfile(self._filename + ".syn"): + with open(self._filename + ".syn", mode="rb") as synFile: + synBytes = synFile.read() + if (synBytes == ''): + return {} + synBytesLen = len(synBytes) synDict = {} pos = 0
The text was updated successfully, but these errors were encountered:
StarDict reader: support .syn.dz file, #410
cdd3155
Done.
Sorry, something went wrong.
No branches or pull requests
feature request: process stardict .syn.dz files as well.
at the moment they need to be unpacked and saved as .syn files fist.
this works for me:
The text was updated successfully, but these errors were encountered: