+ zip.write(get_resource('res/jedenprocent.png'), os.path.join('OPS', 'jedenprocent.png'))
+ if not style:
+ style = get_resource('epub/style.css')
+ zip.write(style, os.path.join('OPS', 'style.css'))
+
+ if cover:
+ if cover is True:
+ cover = WLCover
+ if cover.uses_dc_cover:
+ if document.book_info.cover_by:
+ document.edoc.getroot().set('data-cover-by', document.book_info.cover_by)
+ if document.book_info.cover_source:
+ document.edoc.getroot().set('data-cover-source', document.book_info.cover_source)
+
+ cover_file = StringIO()
+ c = cover(document.book_info)
+ c.save(cover_file)
+ c_name = 'cover.%s' % c.ext()
+ zip.writestr(os.path.join('OPS', c_name), cover_file.getvalue())
+ del cover_file
+
+ cover_tree = etree.parse(get_resource('epub/cover.html'))
+ cover_tree.find('//' + XHTMLNS('img')).set('src', c_name)
+ zip.writestr('OPS/cover.html', etree.tostring(
+ cover_tree, method="html", pretty_print=True))