View Single Post
Old 09-13-2019, 08:51 PM   #30
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
Thanks for this. I've tried your suggestions and have been able to run the plugin as standalone and from the calibre GUI - with a working QWebEngineView widget.

After thinking about it some more I can see that there is an advantage to the standalone not needing to have a local copy of scrambleebook.py and the images directory. A simple .bat should be OK

Code:
echo off
calibre-debug --run-plugin ScrambleEbook %1
A few questions though ...

In the plugin's uiaction.py to start the dialog it used to have
Code:
dlg = EbookScramble(path_to_ebook, book_id=book_id, from_calibre=True, parent=self.gui)
dlg.exec_()
and now I think you're suggesting it runs itself from itself?
Code:
from calibre.debug import run_calibre_debug
run_calibre_debug('--run-plugin', 'ScrambleEbook', path_to_ebook)
I'm not sure yet whether the book_id arg is still needed because the path_to_book has already been set at this point, but I do still want the from_calibre parameter set to True when run from calibre GUI. Where do I put this?

I thought this might work but it doesn't.
Code:
run_calibre_debug('--run-plugin', 'ScrambleEbook', path_to_ebook, 'True')
jackie_w is offline   Reply With Quote