Thank you both very much! Now I know that I'm doing something wrong!
First, I tried to convert a .dsl file into a StarDict file and then use Penelope, which produced an invalid Kobo dictionary, and compile/recompile with dictutil didn't help. Then I tried an old StarDict file I had and used Penelope again, and that worked. When I tried that same StarDict dictionary and used PyGlossary directly to get a Kobo dictionary, I got a write error:
Spoiler:
Code:
Using Reader class from Stardict plugin for direct conversion without loading into memory
Writing to Kobo format requires full sort, falling back to indirect mode
Loaded 91968 entries
Writing to file 'D:\\Downloads\\Portable Python 3.6.5 x64\\AHD4-2.4.2\\AHD4.kobo'
Exception while calling plugin's write function
Traceback (most recent call last):
File "D:\Downloads\Portable Python 3.6.5 x64\pyglossary-3.3.0\pyglossary\glossary.py", line 932, in write
writer.write(filename, **options)
File "D:\Downloads\Portable Python 3.6.5 x64\pyglossary-3.3.0\pyglossary\plugins\ebook_kobo.py", line 97, in write
words = self.write_groups(group_by_prefix_length)
File "D:\Downloads\Portable Python 3.6.5 x64\pyglossary-3.3.0\pyglossary\plugins\ebook_kobo.py", line 80, in write_groups
with gzip.open(group_fname + ".html", mode="wb") as gzipFile:
File "D:\Downloads\Portable Python 3.6.5 x64\App\Python\lib\gzip.py", line 53, in open
binary_file = GzipFile(filename, gz_mode, compresslevel)
File "D:\Downloads\Portable Python 3.6.5 x64\App\Python\lib\gzip.py", line 163, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
OSError: [Errno 22] Invalid argument: 'B<.html'
Writing file 'D:/Downloads/Portable Python 3.6.5 x64/AHD4-2.4.2/AHD4.kobo' failed.
I understand that Kobo is a fresh addition to PyGlossary version 3.3, so it could just be that the kinks haven't yet been worked out. Finally, I tried makedict (thank you Semwize!) to convert a .dsl to StarDict and used Penelope to get to Kobo, which worked. Decompile and compile with dictutil worked also. (Btw, are there any recommended parameters for compile/recompile of Penelope dictionaries? While I was testing, I just used drag and drop. I suppose that my old conversions would benefit from a dictutil pass-through, so if it's simple enough I might just go through them all.)
I have yet to try and tinker with Babylon or any other features that depend on PyGlossary. I was able to find a different tool that extracts the content from .mdx files and exports it directly to a .txt file, but one look into the file tells me that removing all the stylesheet references, internal links, span tags and the like is going to be a huge pain. Still, it seems to be the best option for .mdx files to date, if I can only streamline the process of cleaning up the file so that dictutil can read it. (I'd appreciate any tips on that.)
Bottom line is, PyGlossary seems to be the point of error for me, as it somehow corrupts the StarDict version and that poisons the rest of the chain. The thing is, there are no errors during the conversion process from .dsl to StarDict, as far as I can see, but if one thing isn't working, it stands to reason that others might not work either. I can't seem to pinpoint what I'm doing wrong. I'd certainly like to get PyGlossary working since most people consider it to be the norm, if nothing else than to try and extract some .mdx data from it and see if it's any easier than the method I've found.