1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-03-13 21:25:54 +01:00

Convert calibre modules to ebook_converter.

Here is the first batch of modules, which are needed for converting
several formats to LRF. Some of the logic has been change, more cleanups
will follow.
This commit is contained in:
2020-04-11 19:33:43 +02:00
parent 69d2e536c5
commit 0f9792df36
252 changed files with 1925 additions and 2344 deletions

View File

@@ -1,4 +1,3 @@
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
"""
@@ -6,9 +5,9 @@ Provides platform independent temporary files that persist even after
being closed.
"""
import tempfile, os, atexit
from polyglot.builtins import map, getenv
from ebook_converter.polyglot.builtins import map, getenv
from calibre.constants import (__version__, __appname__, filesystem_encoding,
from ebook_converter.constants import (__version__, __appname__, filesystem_encoding,
iswindows, get_windows_temp_path, isosx, ispy3)
@@ -91,8 +90,8 @@ def base_dir():
if _base_dir is None:
td = os.environ.get('CALIBRE_WORKER_TEMP_DIR', None)
if td is not None:
from calibre.utils.serialize import msgpack_loads
from polyglot.binary import from_hex_bytes
from ebook_converter.utils.serialize import msgpack_loads
from ebook_converter.polyglot.binary import from_hex_bytes
try:
td = msgpack_loads(from_hex_bytes(td))
except Exception: