Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-06-2012, 12:35 PM   #1
hakan42
Zealot
hakan42 is on a distinguished road
 
hakan42's Avatar
 
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
hakan42 is offline   Reply With Quote
Old 09-06-2012, 12:45 PM   #2
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Is it a gui plugin? Then you can use self.gui.current_db
kiwidude is offline   Reply With Quote
 
Enthusiast
Old 09-06-2012, 05:35 PM   #3
hakan42
Zealot
hakan42 is on a distinguished road
 
hakan42's Avatar
 
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.
hakan42 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


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


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