MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Development (https://www.mobileread.com/forums/forumdisplay.php?f=240)
-   -   Loading Plugin in development (https://www.mobileread.com/forums/showthread.php?t=241183)

Sladd 06-16-2014 04:47 PM

Loading Plugin in development
 
Hello !

The question might have been asked a thousand times already, but I can't find the answer to this simple question :

I have a Plugin I'm trying to develop for Calibre, the point is easy, but I need to do some try&errors, and I need to reload the plugin often.

But it's a bit long, actually, I start Calibre, uninstall the actual version, install the new, and relaunch Calibre in order to have the button in the Toolbar.

Is there a better way ?

When I try to change the Plugin.zip in %appdata%/calibre/plugins, the button disapear from the toolbar.

Thanks you for reading me !

PeterT 06-16-2014 10:05 PM

Does http://manual.calibre-ebook.com/crea...ugging-plugins help ?

davidfor 06-16-2014 11:56 PM

I use a command file to package the plugin and start calibre.

Code:

del "KoboUtilities.zip"
"c:\Program Files\7-Zip\7z.exe" a "KoboUtilities.zip" __init__.py about.txt action.py book.py common_utils.py container.py dialogs.py jobs.py config.py "KoboUtilities_Help.html" plugin-import-name-KoboUtilities.txt run.cmd images/* translations/*.po translations/*.mo
mode 165,999
calibre-debug -s
calibre-customize -a "KoboUtilities.zip"
SET CALIBRE_DEVELOP_FROM=D:\Development\GitHub\calibre\src
calibre-debug  -g

That:
  • Removes and rebuilds the zip file
  • Stops the current calibre session
  • Sets the command window size to maximum for my screen
  • Adds the plugin to calibre
  • Sets an environment variable to point to the calibre source
  • Starts calibre in debug mode

Setting the environment variable is only needed if you want to run calibre from source. For a plugin, you don't usually need to.

Sladd 06-17-2014 05:50 AM

Hello !

Both of your method install the plugin, but I don't see the icon in the toolbar, the plugin is just installed, not placed in the toolbar.

No way to go around this ?

davidfor 06-17-2014 10:08 AM

You will need to add it to the appropriate toolbar using the preferences. The installation can prompt the user to do this.

Sladd 06-17-2014 12:15 PM

When I install the plugin byt the preference, yeah, I'm prompted.

But I need to do this manually, every time, it's quite time consuming for a fast workflow, no ?

jackie_w 06-17-2014 07:57 PM

Quote:

Originally Posted by Sladd (Post 2853340)
When I install the plugin byt the preference, yeah, I'm prompted.

But I need to do this manually, every time, it's quite time consuming for a fast workflow, no ?

Once the plugin icon is on your chosen toolbar you shouldn't need to add it each time you update the plugin zip file - at least I don't.

If the icon is no longer visible after a calibre restart it's probably because there is an error in the updated plugin and it has failed to load correctly during the restart. Restarting calibre in debug mode (calibre-debug -g) would show these errors in the debug log.


All times are GMT -4. The time now is 08:24 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.