mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'py3' of https://github.com/eli-schwartz/calibre
This commit is contained in:
commit
38d463220c
@ -22,6 +22,7 @@ from calibre.ebooks.oeb.polish.toc import TOC, create_ncx
|
|||||||
from calibre.utils.localization import lang_as_iso639_1
|
from calibre.utils.localization import lang_as_iso639_1
|
||||||
from calibre.utils.logging import DevNull
|
from calibre.utils.logging import DevNull
|
||||||
from calibre.utils.zipfile import ZipFile, ZIP_STORED
|
from calibre.utils.zipfile import ZipFile, ZIP_STORED
|
||||||
|
from polyglot.builtins import as_bytes
|
||||||
|
|
||||||
valid_empty_formats = {'epub', 'txt', 'docx', 'azw3'}
|
valid_empty_formats = {'epub', 'txt', 'docx', 'azw3'}
|
||||||
|
|
||||||
@ -42,7 +43,7 @@ def create_book(mi, path, fmt='epub', opf_name='metadata.opf', html_name='start.
|
|||||||
if fmt == 'txt':
|
if fmt == 'txt':
|
||||||
with open(path, 'wb') as f:
|
with open(path, 'wb') as f:
|
||||||
if not mi.is_null('title'):
|
if not mi.is_null('title'):
|
||||||
f.write(mi.title)
|
f.write(as_bytes(mi.title))
|
||||||
return
|
return
|
||||||
if fmt == 'docx':
|
if fmt == 'docx':
|
||||||
from calibre.ebooks.conversion.plumber import Plumber
|
from calibre.ebooks.conversion.plumber import Plumber
|
||||||
|
Loading…
x
Reference in New Issue
Block a user