10-04-2014, 02:48 AM | #1 |
Noob Developer
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.
|
10-04-2014, 04:30 AM | #2 |
Grand Sorcerer
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) |
Advert | |
|
10-04-2014, 09:17 AM | #3 |
Noob Developer
Posts: 25
Karma: 219932
Join Date: Aug 2014
Location: Texas
Device: Amazon Fire 7
|
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. |
10-04-2014, 09:21 AM | #4 |
creator of calibre
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 |
10-04-2014, 09:44 AM | #5 | |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
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. |
|
Advert | |
|
10-04-2014, 10:00 AM | #6 | ||
Noob Developer
Posts: 25
Karma: 219932
Join Date: Aug 2014
Location: Texas
Device: Amazon Fire 7
|
Quote:
Quote:
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. |
||
10-04-2014, 10:54 AM | #7 |
creator of calibre
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...
|
10-04-2014, 12:13 PM | #8 |
Noob Developer
Posts: 25
Karma: 219932
Join Date: Aug 2014
Location: Texas
Device: Amazon Fire 7
|
|
|
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 |