09-06-2012, 12:35 PM | #1 |
Zealot
Posts: 136
Karma: 60
Join Date: Jul 2009
Location: Munich, Germany
Device: Nook Classic rooted; Galaxy S IV with Aldiko, other older devices
|
How to access "database" from a plugin
Hi,
In a plugin I am writing, I need to access the "database" object from database2.py, using that reference to access metadata, authors and titles through it. Sadly, my Python-Fu is severely lacking so I can't find a way to do this. Could anyone give me a pointer where to look? Regards, Hakan |
09-06-2012, 12:45 PM | #2 |
Calibre Plugins Developer
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Is it a gui plugin? Then you can use self.gui.current_db
|
09-06-2012, 05:35 PM | #3 |
Zealot
Posts: 136
Karma: 60
Join Date: Jul 2009
Location: Munich, Germany
Device: Nook Classic rooted; Galaxy S IV with Aldiko, other older devices
|
It is for a new type of plugin i'm trying to create (more hopefully in a pull request later this month). Thank you for the hint with gui plugins, I'll check how they are initialized and keep the reference to the database.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Database Disk Image is malformed" when connecting to Calibre after adding new books | djorkboy | Kobo Reader | 13 | 10-07-2010 08:47 PM |
"Database Disk Image is malformed" when connecting to Calibre after adding new books | djorkboy | Calibre | 1 | 10-06-2010 08:59 PM |
Making a "library" database on Access | lilac_jive | Lounge | 0 | 12-22-2008 09:00 PM |
Adding "Wanted" books to Calibre database? | itimpi | Calibre | 6 | 11-26-2008 03:14 PM |