View Single Post
Old 08-06-2013, 06:42 PM   #12
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
Your pointer to BOOK_EXTENSIONS led me to find that ConfigWidget gets its list of formats from the FORMATS set (or list) defined on the device. If the device driver defines USER_CAN_ADD_NEW_FORMATS=True (which is the default) this set from the driver is union()'d with BOOK_EXTENSIONS. So I was able to add kepub just by adding "FORMATS = set(['kepub'])" as a class-level variable. Haven't tested it yet, but that comes soon

For the metadata, the only thing I haven't seen yet is how to get an instance of the Metadata object for the book I'm currently converting. Nothing jumps out at me, not even how to get a unique identifier for the book being converted, but if the container's OPF file is updated with the metadata from calibre by the time convert() is called I'm perfectly OK with taking the (limited) information I'm looking for out of the OPF file.

EDIT: The OPF file is indeed updated and I've been able to get everything I was looking for! Now, to test with my driver to make sure these new 'kepub' files actually transfer correctly

Last edited by jgoguen; 08-06-2013 at 09:17 PM.
jgoguen is offline   Reply With Quote