moved get_calibre_binarypath() to helper.py

This commit is contained in:
Thore Schillmann
2022-07-07 11:41:51 +00:00
parent 0d34f41a48
commit fc004f4f0c
5 changed files with 20 additions and 19 deletions

View File

@@ -37,7 +37,7 @@ from cps.ub import init_db_thread
from cps.tasks.mail import TaskEmail
from cps import gdriveutils
from cps.constants import SUPPORTED_CALIBRE_BINARIES
log = logger.create()
@@ -238,7 +238,7 @@ class TaskConvert(CalibreTask):
tmp_dir = os.path.join(gettempdir(), 'calibre_web')
if not os.path.isdir(tmp_dir):
os.mkdir(tmp_dir)
calibredb_binarypath = config.get_calibre_binarypath("calibredb")
calibredb_binarypath = os.path.join(config.config_binariesdir, SUPPORTED_CALIBRE_BINARIES["calibredb"])
opf_command = [calibredb_binarypath, 'show_metadata', '--as-opf', str(book_id), '--with-library', config.config_calibre_dir]
p = process_open(opf_command, quotes)
path_tmp_opf = os.path.join(tmp_dir, "metadata_" + str(current_milli_time()) + ".opf")
@@ -258,7 +258,7 @@ class TaskConvert(CalibreTask):
quotes_index += 1
p = process_open(command, quotes, newlines=False)
except (ValueError, OSError) as e:
except OSError as e:
return 1, N_(u"Ebook-converter failed: %(error)s", error=e)
while p.poll() is None: