mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
...
This commit is contained in:
parent
2dd0cc3668
commit
f81d89a76b
@ -227,7 +227,9 @@ class KOBO(USBMS):
|
|||||||
try:
|
try:
|
||||||
cursor.execute (query)
|
cursor.execute (query)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if '___ExpirationStatus' not in str(e):
|
err = str(e)
|
||||||
|
if not ('___ExpirationStatus' in err or 'FavouritesIndex' in err or
|
||||||
|
'Accessibility' in err):
|
||||||
raise
|
raise
|
||||||
query= ('select Title, Attribution, DateCreated, ContentID, MimeType, ContentType, '
|
query= ('select Title, Attribution, DateCreated, ContentID, MimeType, ContentType, '
|
||||||
'ImageID, ReadStatus, "-1" as ___ExpirationStatus, "-1" as '
|
'ImageID, ReadStatus, "-1" as ___ExpirationStatus, "-1" as '
|
||||||
|
@ -20,7 +20,7 @@ class HTMLZInput(InputFormatPlugin):
|
|||||||
author = 'John Schember'
|
author = 'John Schember'
|
||||||
description = 'Convert HTML files to HTML'
|
description = 'Convert HTML files to HTML'
|
||||||
file_types = set(['htmlz'])
|
file_types = set(['htmlz'])
|
||||||
|
|
||||||
def convert(self, stream, options, file_ext, log,
|
def convert(self, stream, options, file_ext, log,
|
||||||
accelerators):
|
accelerators):
|
||||||
self.log = log
|
self.log = log
|
||||||
@ -35,14 +35,14 @@ class HTMLZInput(InputFormatPlugin):
|
|||||||
with open(x, 'rb') as tf:
|
with open(x, 'rb') as tf:
|
||||||
html = tf.read()
|
html = tf.read()
|
||||||
break
|
break
|
||||||
|
|
||||||
# Encoding
|
# Encoding
|
||||||
if options.input_encoding:
|
if options.input_encoding:
|
||||||
ienc = options.input_encoding
|
ienc = options.input_encoding
|
||||||
else:
|
else:
|
||||||
ienc = xml_to_unicode(html[:4096])[-1]
|
ienc = xml_to_unicode(html[:4096])[-1]
|
||||||
html = html.decode(ienc, 'replace')
|
html = html.decode(ienc, 'replace')
|
||||||
|
|
||||||
# Run the HTML through the html processing plugin.
|
# Run the HTML through the html processing plugin.
|
||||||
from calibre.customize.ui import plugin_for_input_format
|
from calibre.customize.ui import plugin_for_input_format
|
||||||
html_input = plugin_for_input_format('html')
|
html_input = plugin_for_input_format('html')
|
||||||
@ -71,7 +71,7 @@ class HTMLZInput(InputFormatPlugin):
|
|||||||
from calibre.ebooks.oeb.transforms.metadata import meta_info_to_oeb_metadata
|
from calibre.ebooks.oeb.transforms.metadata import meta_info_to_oeb_metadata
|
||||||
mi = get_file_type_metadata(stream, file_ext)
|
mi = get_file_type_metadata(stream, file_ext)
|
||||||
meta_info_to_oeb_metadata(mi, oeb.metadata, log)
|
meta_info_to_oeb_metadata(mi, oeb.metadata, log)
|
||||||
|
|
||||||
# Get the cover path from the OPF.
|
# Get the cover path from the OPF.
|
||||||
cover_path = None
|
cover_path = None
|
||||||
opf = None
|
opf = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user