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-21-2015, 04:57 AM   #1
esvorontsov
Member
esvorontsov began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
How to get a list of books corresponding to the selected tag in the GUI plugin?

Hello

The user selects the tag by the left mouse button. Calibre shows book list that correspond to the selected tag.

How to get a list of books corresponding to the selected tag in the GUI plugin code to write the metadata to a remote database?

Last edited by esvorontsov; 09-21-2015 at 04:59 AM.
esvorontsov is offline   Reply With Quote
Advert
Old 09-21-2015, 05:15 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 31,842
Karma: 8697710
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
m = self.gui.library_view.model()
book_ids = {m.id(x) for x in range(m.rowCount()}
kovidgoyal is offline   Reply With Quote
Old 09-21-2015, 07:54 AM   #3
esvorontsov
Member
esvorontsov began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
How to get metadata of each book using book_ids?
esvorontsov is offline   Reply With Quote
Old 09-21-2015, 08:19 AM   #4
esvorontsov
Member
esvorontsov began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
_____
esvorontsov is offline   Reply With Quote
Old 09-21-2015, 09:30 AM   #5
esvorontsov
Member
esvorontsov began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
Quote:
Originally Posted by kovidgoyal View Post
Code:
m = self.gui.library_view.model()
book_ids = {m.id(x) for x in range(m.rowCount()}
in Python 2.7 need to use xrange, but it is not important
m.rowCount() requires two arguments - ???
what is the name of the model class?
what method of the model class will return the metadata for book_id?
esvorontsov is offline   Reply With Quote
Advert
Old 09-21-2015, 10:11 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 31,842
Karma: 8697710
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
m = self.gui.library_view.model()
book_ids = {m.id(x) for x in range(m.rowCount(None)}
self.gui.current_db.new_api.get_metadata(book_id)
print (m.__class__)
http://manual.calibre-ebook.com/deve...rts-of-calibre
kovidgoyal is offline   Reply With Quote
Old 09-29-2015, 11:06 AM   #7
esvorontsov
Member
esvorontsov began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2015
Device: sdfvsdvsdvsdvsd
thank
esvorontsov 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
[GUI Plugin] Reading List kiwidude Plugins 769 12-10-2017 03:23 PM
[GUI Plugin] Import List kiwidude Plugins 292 11-10-2017 11:38 AM
Getting IDs of books selected in the GUI wladdy Calibre 3 05-09-2015 07:23 AM
[GUI Plugin] Manage Sony x50 Reader Book List kpw Plugins 170 10-02-2014 09:23 PM


All times are GMT -4. The time now is 08:09 AM.


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