View Single Post
Old 09-14-2019, 01:42 PM   #36
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,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by kovidgoyal View Post
In The plugin you have a separate ui.py. All is needs to do is run

Code:
self.gui.job_manager.launch_gui_app('webengine-dialog', {'module':  'calibre_plugins_your_plugin_import_name.main',  'path': path_to_book})
Then in the main.py file have a function named

Code:
def main(path_to_book):
this can run the actual plugin with the webengine based UI
It's working, let joy be unconfined! I decided to use a hybrid solution which uses eschwartz's cli method if running standalone and your new 3.99.4 method when running from the calibre GUI.

I'd like to clarify something about the latter.

In the show_dialog called by genesis() I have
Code:
self.gui.job_manager.launch_gui_app('webengine-dialog',
    kwargs={
        'module':'calibre_plugins.scrambleebook_plugin.main',
        'path_to_ebook':path_to_ebook,
        'book_id':book_id,
        'from_calibre':True
        }
    )
and a separate main.py file in the plugin containing only a single function
Code:
def main(path_to_ebook, book_id, from_calibre)
Are the 2 red names constant or can you choose your own. I'm assuming they are constant?
jackie_w is offline   Reply With Quote