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 10-04-2014, 02:48 AM   #1
stanking
Noob Developer
stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.
 
stanking's Avatar
 
Posts: 25
Karma: 219932
Join Date: Aug 2014
Location: Texas
Device: Amazon Fire 7
List of Installed Plugins

Where would I find a list of installed plugins? I want to display the installed (custom) plugins and possibly call some of their methods from my own. I'm pretty sure this is a noob question, but then, I'm pretty noob. I've been looking on my own and can't find the proper modules for this.
stanking is offline   Reply With Quote
Old 10-04-2014, 04:30 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
You probably don't need a list of plugins, just to check if one you want to use is installed. The following is what I use to add a book to the a reading list. I probably stole this from the FanFictionDownloader plugin as it uses several other plugins.

Code:
    def update_reading_lists(self, book_ids):
        rl_plugin = self.gui.iactions['Reading List']

        reading_lists = []
        for list_name in rl_plugin.get_list_names():
            reading_lists.extend(rl_plugin.get_book_list(list_name))
        debug_print("update_reading_lists - reading_lists", reading_lists)
        toread_book_ids = []
        for book_id in book_ids:
            if not book_id in reading_lists:
                toread_book_ids.append(book_id)
        debug_print("update_reading_lists - toread_book_ids", toread_book_ids)

        send_on_connect_list = "Send on connect"
        rl_plugin.add_books_to_list(send_on_connect_list, book_ids, display_warnings=False)

        toread_list = "To Read"
        rl_plugin.add_books_to_list(toread_list, toread_book_ids, display_warnings=False)
davidfor is offline   Reply With Quote
Advert
Old 10-04-2014, 09:17 AM   #3
stanking
Noob Developer
stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.
 
stanking's Avatar
 
Posts: 25
Karma: 219932
Join Date: Aug 2014
Location: Texas
Device: Amazon Fire 7
Quote:
Originally Posted by davidfor View Post
You probably don't need a list of plugins...
Your code snippet helps, and it may do the job, but yeah, I really do need a list. My secret goal is to provide the user a list of plugins he/she can string together to run in succession. Blame BetterRed; he put me on the idea:

Quote:
Originally Posted by BetterRed View Post
But here's maybe a better idea if your interested. A PI that would allow the user to string a series of actions into a 'work task' - eg Extract ISBN, Polish ISBN, Download Metadata - or another one might be Convert, Count Pages, Modify.
But baby steps, this gets me a little closer.
stanking is offline   Reply With Quote
Old 10-04-2014, 09:21 AM   #4
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: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
self.gui.iactions is a mapping of plugin name to plugin object(for all user interface action plugins). So if you want a list

list(self.gui.iactions)

And if you want to iterate over all types of plugins, then use the functions in calibre.customize.ui
kovidgoyal is offline   Reply With Quote
Old 10-04-2014, 09:44 AM   #5
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by stanking View Post
Your code snippet helps, and it may do the job, but yeah, I really do need a list. My secret goal is to provide the user a list of plugins he/she can string together to run in succession. Blame BetterRed; he put me on the idea:



But baby steps, this gets me a little closer.
OK, I remember seeing that suggestion.

For a list of plugins, have a look at the Marvin plugin. I don't have it installed at the moment, but it lists all user plugins when the calibre is started in debug mode.

But, I think you will still have to work with a known list of plugins. The real problem is going to be knowing what they do and if they have any function that can be called externally. I know Reading List does and I remember JimmXinu working with kiwidude to change the interface so he could call it. It has options to suppress error message boxes and throw exceptions instead.
davidfor is offline   Reply With Quote
Advert
Old 10-04-2014, 10:00 AM   #6
stanking
Noob Developer
stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.
 
stanking's Avatar
 
Posts: 25
Karma: 219932
Join Date: Aug 2014
Location: Texas
Device: Amazon Fire 7
Quote:
Originally Posted by kovidgoyal View Post
self.gui.iactions is a mapping of plugin name to plugin object(for all user interface action plugins). So if you want a list

list(self.gui.iactions)

And if you want to iterate over all types of plugins, then use the functions in calibre.customize.ui
Can't get more authoritative than that. Thanks, Kovid! (Dude, he actually talked to me!!!)
Quote:
Originally Posted by davidfor View Post
But, I think you will still have to work with a known list of plugins. The real problem is going to be knowing what they do and if they have any function that can be called externally. I know Reading List does and I remember JimmXinu working with kiwidude to change the interface so he could call it. It has options to suppress error message boxes and throw exceptions instead.
Yeah, you're right, but it will be helpful to pull the user's installed list, and unless I want to modify my code every time a new candidate comes along, I have to provide the user a way to use a new plugin if it works.
There's all kinds of speed bumps to an idea like this. Getting buy-in from other developers to provide hooks and suppress the message boxes would be key. Even then, I don't see launching this without huge danger signs attached, but if you do the same 4 things to each book or group of books you import, it would be nice to automate the process.
stanking is offline   Reply With Quote
Old 10-04-2014, 10:54 AM   #7
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: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You're welcome and if you look through the threads in the Development forum, you'll realize I talk to most everybody. Not to keep you from feeling special or anything...
kovidgoyal is offline   Reply With Quote
Old 10-04-2014, 12:13 PM   #8
stanking
Noob Developer
stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.stanking ought to be getting tired of karma fortunes by now.
 
stanking's Avatar
 
Posts: 25
Karma: 219932
Join Date: Aug 2014
Location: Texas
Device: Amazon Fire 7
Quote:
Originally Posted by kovidgoyal View Post
You're welcome and if you look through the threads in the Development forum, you'll realize I talk to most everybody. Not to keep you from feeling special or anything...
stanking is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Paperwhite 3 (PW3) features list speculation/wish list markbot Amazon Kindle 115 09-09-2014 10:59 AM
Recommendation - Maintain updated list of depreciated plugins azteech Plugins 7 07-23-2012 07:04 PM
Plugins junkml Plugins 32 06-19-2009 06:43 AM
Plugins? Mitchll Plugins 0 12-27-2008 02:36 PM


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


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