View Single Post
Old 09-12-2019, 02:01 PM   #26
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by eschwartz View Post
I'm mobile right now, cannot check the source code and offer specific examples, but what I'm basically thinking is that you should be able to get the images by instantiating your plugin in the calibre-debug subprocess and using https://manual.calibre-ebook.com/plu...load_resources

Also see cli_main() there. This seems like a much simpler approach: You'd want to allow the cli_main entry point to spin up your QApplication with a path to an ebook file in order to run the plugin, just as if you had used the batch file instead.

In fact, this could replace the batch file. Users would simply install the plugin, and then the batch file would run 'calibre-debug --run-plugin ScrambleEbook path-to-epub'.

Then the final step would be that on newer versions of Calibre with webengine instead of webkit, the plugin will simply call run_calibre_debug and start up the command line interface for the plugin.

If this isn't enough of a hint for you, I will try to explain in greater detail and hopefully with code samples, tonight or tomorrow or something. Or Kovid can fill in the blanks.
I can wait. I'm not so much in a hurry to complete the fix as I am to know whether it is fixable in a way I have a chance of understanding and supporting long-term.

I don't use cli_main() and have never planned to become an expert. It's not something I'll ever use anywhere else. I'm not against a one-line solution which uses it, though, if handed to me on a plate. I'm afraid your hints (while well-intentioned and gratefully received ) aren't enough.

Re: the standalone version. I don't really want a different solution to that as I don't think it's broken as-is.
jackie_w is offline   Reply With Quote