Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 11-24-2020, 02:27 PM   #1
ElmoFuntz
Junior Member
ElmoFuntz began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2013
Device: Nook, iPad, Audiobooks
Example plugin not working?

So I'm new to Python and the Calibre API (but not programming) and was trying to muddle my way through figuring both out by updating an old plugin for v5. Starting to think just redoing the pieces I need for now might be easier. To do this I was starting at the basics with the stuff at https://manual.calibre-ebook.com/creating_plugins.html but the very basic plugin that should update the publisher to "hello world" is not even working. It shows the plugin loaded but importing a new epub does not add the publisher when there is none in the original metadata or when there is a publisher on the book it loads the one on the epub. Since I'm trying to do a plugin that will be manipulating/adding metadata for m4b files this example looked like a good start. Can anyone give me an idea of why? Does it need to be updated for v5? TIA.
ElmoFuntz is offline   Reply With Quote
Old 11-24-2020, 02:53 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,617
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by ElmoFuntz View Post
So I'm new to Python and the Calibre API (but not programming) and was trying to muddle my way through figuring both out by updating an old plugin for v5. Starting to think just redoing the pieces I need for now might be easier. To do this I was starting at the basics with the stuff at https://manual.calibre-ebook.com/creating_plugins.html but the very basic plugin that should update the publisher to "hello world" is not even working. It shows the plugin loaded but importing a new epub does not add the publisher when there is none in the original metadata or when there is a publisher on the book it loads the one on the epub. Since I'm trying to do a plugin that will be manipulating/adding metadata for m4b files this example looked like a good start. Can anyone give me an idea of why? Does it need to be updated for v5? TIA.
If you check the documentation for the helloworld plugin, you'll find the words:

Quote:
Every time you use calibre to convert a book, the plugin’s run() method will be called and the converted book will have its publisher set to “Hello World”. This is a trivial plugin, lets move on to a more complex example that actually adds a component to the user interface.
I have not tried installing it so I have no idea if it will work when converting an ebook.

Last edited by DNSB; 11-24-2020 at 02:55 PM.
DNSB is offline   Reply With Quote
Old 11-24-2020, 03:03 PM   #3
ElmoFuntz
Junior Member
ElmoFuntz began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2013
Device: Nook, iPad, Audiobooks
Yeah I noticed that after I posted it said during conversion so I tried a conversion and same deal no change unless I am looking in the wrong place. I also dropped a print statement in to see if it even reaches the line that should be setting this but the conversion just sits at "waiting" when in debug mode.
ElmoFuntz is offline   Reply With Quote
Old 11-24-2020, 03:10 PM   #4
ElmoFuntz
Junior Member
ElmoFuntz began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2013
Device: Nook, iPad, Audiobooks
Quote:
Originally Posted by ElmoFuntz View Post
Yeah I noticed that after I posted it said during conversion so I tried a conversion and same deal no change unless I am looking in the wrong place. I also dropped a print statement in to see if it even reaches the line that should be setting this but the conversion just sits at "waiting" when in debug mode.
Nevermind at first I did not think it did because it's showing the original data but if I select the format I converted to and hit the "set the metadata from the selected format" button it shows the change. Is this the only way to see that?

So now I need to figure out how I can do this same thing at import.. Thanks though this helps.
ElmoFuntz is offline   Reply With Quote
Old 11-24-2020, 03:29 PM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,617
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by ElmoFuntz View Post
Nevermind at first I did not think it did because it's showing the original data but if I select the format I converted to and hit the "set the metadata from the selected format" button it shows the change. Is this the only way to see that?
As near as I can tell, it is updating the metadata in the converted book so that will be needed.

Quote:
Originally Posted by ElmoFuntz View Post
So now I need to figure out how I can do this same thing at import.. Thanks though this helps.
Have fun.
DNSB is offline   Reply With Quote
Old 12-11-2020, 02:59 AM   #6
DisasterArea
Junior Member
DisasterArea began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2012
Device: none
Dear ElmoFuntz, I observed the same behavior. I'm trying to start API Programming but it seems that the examples and documentation do not reflect the new 5 th version. I installed that Hello World example an did convert one Book (yes and restarted calirbe, if this might be necessary). But there is not "Hello World" in any of the fields. I get stuck here and am searching for a good API documentation, examples. If you find some, let us know.
DisasterArea is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calibre 2.0 ,findduplicate plugin not working. yang738 Plugins 2 08-29-2014 09:43 AM
De-DRM plugin not working mlevin77 Conversion 1 06-02-2012 10:36 PM
I09 plugin stopped working phil_ga Recipes 2 02-18-2011 09:53 AM


All times are GMT -4. The time now is 04:21 AM.


MobileRead.com is a privately owned, operated and funded community.