View Single Post
Old 10-25-2012, 11:58 AM   #1
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,831
Karma: 4193095
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Help viewing calibre gui data via commandline

I am trying to get a better understanding of the calibre library data available when creating a typical user interface plugin. Please could someone get me started.

As an example, some simple code I already have in a working plugin is this:
Code:
db = self.gui.library_view.model().db
book_authors = db.authors(book_id, index_is_id=True)
where book_id is a known value.

If I want to create that gui db object in a commandline session (either interactive or in a script.py file) so I can poke around a little (viewing only) what do I need to do?

I've seen the calibre-debug -e myscript.py option in the user manual but I'm not sure how to access the gui data.

Secondly, if the above is possible I would also like to look around the available data when a device is connected (self.gui.device_manager.connected_device when used in a plugin).

In case it's relevant, I don't have any development environment - just my trusty text editor (Notepad++)
jackie_w is online now   Reply With Quote