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 07-20-2025, 10:24 AM   #1
jsky
Junior Member
jsky began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2025
Device: kindle
How to Get Instance of a Plugin?

How to Get Instance of a Plugin Using Calibre's Plugin Framework?
Is there a method like Source.get_plugin_by_name() to get a specific plugin's instance by its name (although I know it does not exist)?
jsky is offline   Reply With Quote
Old 07-20-2025, 10:31 AM   #2
jsky
Junior Member
jsky began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2025
Device: kindle
Because I want to call plugins written by other authors in the plugin I am editing.
jsky is offline   Reply With Quote
Old 07-20-2025, 11:38 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look at the functions in

calibre.customize.ui

they give you access to all types of calibre plugins.
kovidgoyal is offline   Reply With Quote
Old Yesterday, 02:43 AM   #4
jsky
Junior Member
jsky began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2025
Device: kindle
Quote:
Originally Posted by kovidgoyal View Post
Look at the functions in

calibre.customize.ui

they give you access to all types of calibre plugins.
Thank you!Calibre MASTER

and still a little problem --

I am writing a InterfaceAction plugin, in which I want to call a Source plugin function.
Now i have the source plugin instance
Code:
from calibre.customize.ui import find_plugin
plugin = find_plugin("plugin_name")
But the function I want to Call is
Code:
    def identify(
            self,
            log,
            result_queue,
            abort,
            title=None,
            authors=None,  # {{{
            identifiers={},
            timeout=30)
However, I'm not sure how to pass the "log" parameter, as it seems like it's coming from outside the function. How can I pass this parameter correctly?
jsky is offline   Reply With Quote
Old Yesterday, 02:59 AM   #5
jsky
Junior Member
jsky began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2025
Device: kindle
Could this method cause initialization timing issues when one plugin depends on another?
jsky is offline   Reply With Quote
Old Yesterday, 05:41 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Dont call other plugins in your plugins initialize method and you wont have initialization issues. As for parameters to pass to identify() looka t how calibre itself calls the plugin identify methods, in sources/identify.py
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What Does This Mean??? buyifan43 Kindle Developer's Corner 8 01-06-2025 11:17 PM
PW2 dose anybody see this issue? Jasonkindle Kindle Developer's Corner 2 12-12-2024 02:48 PM
PW4 force the E-ink screen to refresh?? kdusr Kindle Developer's Corner 7 09-20-2021 06:02 PM
how to unbrick my Kindle? yuwang Kindle Developer's Corner 10 09-26-2015 08:40 PM
scanned PDF????? xtdn20008 enTourage eDGe 6 06-18-2011 01:48 PM


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


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