mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Delay load MobiReader
This commit is contained in:
parent
16b94a79ef
commit
f95180349c
@ -7,7 +7,6 @@ from abc import abstractmethod, ABCMeta
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from calibre.devices.kindle.apnx_page_generator.pages import Pages
|
from calibre.devices.kindle.apnx_page_generator.pages import Pages
|
||||||
from calibre.ebooks.mobi.reader.mobi6 import MobiReader
|
|
||||||
from calibre.utils.logging import default_log
|
from calibre.utils.logging import default_log
|
||||||
from polyglot.builtins import as_bytes
|
from polyglot.builtins import as_bytes
|
||||||
from calibre.ebooks.pdb.header import PdbHeaderReader
|
from calibre.ebooks.pdb.header import PdbHeaderReader
|
||||||
@ -40,6 +39,7 @@ class IPageGenerator(metaclass=ABCMeta):
|
|||||||
|
|
||||||
|
|
||||||
def mobi_html(mobi_file_path: str) -> bytes:
|
def mobi_html(mobi_file_path: str) -> bytes:
|
||||||
|
from calibre.ebooks.mobi.reader.mobi6 import MobiReader
|
||||||
mr = MobiReader(mobi_file_path, default_log)
|
mr = MobiReader(mobi_file_path, default_log)
|
||||||
if mr.book_header.encryption_type != 0:
|
if mr.book_header.encryption_type != 0:
|
||||||
raise Exception("DRMed book")
|
raise Exception("DRMed book")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user