Dont load Qt in db.backend until needed

This commit is contained in:
Kovid Goyal 2022-03-17 18:27:26 +05:30
parent f72ecb6a0e
commit 1163242fa6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -47,7 +47,6 @@ from calibre.utils.formatter_functions import (
load_user_template_functions, unload_user_template_functions load_user_template_functions, unload_user_template_functions
) )
from calibre.utils.icu import sort_key from calibre.utils.icu import sort_key
from calibre.utils.img import save_cover_data_to
from polyglot.builtins import ( from polyglot.builtins import (
cmp, iteritems, itervalues, native_string_type, reraise, string_or_bytes cmp, iteritems, itervalues, native_string_type, reraise, string_or_bytes
) )
@ -1527,6 +1526,7 @@ class DB:
with lopen(path, 'wb') as f: with lopen(path, 'wb') as f:
f.write(data) f.write(data)
else: else:
from calibre.utils.img import save_cover_data_to
try: try:
save_cover_data_to(data, path) save_cover_data_to(data, path)
except OSError: except OSError: