View Single Post
Old 10-29-2013, 09:59 AM   #8
bibihoma
Junior Member
bibihoma began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Oct 2013
Device: kindle
Re Kovidgoyal,

Sorry, once again, I'll ask for your help to go beyond this first major achievement: extracting the title of the ebook ;-)
I am now trying to extract the content itself. Shall I use load_html?
If so, how can I instantiate a View to pass to this fuction?

Code:
 
from calibre.ebooks.oeb.iterator.book import EbookIterator
from calibre.ebooks.oeb.display.webview import load_html    
    iterator = EbookIterator("C:/Users/MCProject/Dropbox/Colin/DjangAptana/mysite/kdfr.fb2") 
    iterator.__enter__()
    logger.debug(iterator)     
    logger.debug(iterator.opf.title) 
    for doc in iterator.spine:
        print doc
        load_html(doc, view, codec=getattr(doc, 'encoding', 'utf-8'), mime_type=getattr(path,'mime_type', 'text/html'))
Thanks, Bibihoma
bibihoma is offline   Reply With Quote