コード例 #1
0
def create_kf8_book(oeb, opts, resources):

    # I need to know to text_length without CSS
    class DummyKF8Writer(KF8Writer):
        def extract_css_into_flows(self):
            pass

    dummy_writer = DummyKF8Writer(oeb, opts, resources)
    writer = KF8Writer(oeb, opts, resources)
    book = KF8Book(writer, for_joint=False)

    # This gets written to the MOBI header
    book.text_length = dummy_writer.text_length

    dump_metadata(book.metadata)
    return book
コード例 #2
0
def create_kf8_book(oeb, opts, resources, for_joint=False):
    writer = KF8Writer(oeb, opts, resources)
    return KF8Book(writer, for_joint=for_joint)