View Single Post
Old 10-25-2012, 11:58 AM   #1
jackie_w
Grand Sorcerer
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: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
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 offline   Reply With Quote