View Single Post
Old 09-12-2019, 01:17 PM   #25
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
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.

Last edited by eschwartz; 09-12-2019 at 01:23 PM.
eschwartz is offline   Reply With Quote