Fix annotation retrieval and bump Kobo fimware version

A recent change to BeautifulSoup broke the building of annotations. This
fixes them. But, has only been tested for Kobo devices.

Also, Kobo have just release a firmware update. The only change is for
the supported version numbers.
This commit is contained in:
David 2018-07-04 22:16:46 +10:00
parent 202137dc22
commit 0fb75c2799
2 changed files with 9 additions and 9 deletions

View File

@ -214,13 +214,13 @@ class KINDLE(USBMS):
spanTag = Tag(ka_soup, 'span')
spanTag['style'] = 'font-weight:bold'
if bookmark.book_format == 'pdf':
spanTag.insert(0,NavigableString(
spanTag.insert(0,BeautifulSoup(
_("%(time)s<br />Last page read: %(loc)d (%(pr)d%%)") % dict(
time=strftime(u'%x', timestamp.timetuple()),
loc=last_read_location,
pr=percent_read)))
else:
spanTag.insert(0,NavigableString(
spanTag.insert(0,BeautifulSoup(
_("%(time)s<br />Last page read: Location %(loc)d (%(pr)d%%)") % dict(
time=strftime(u'%x', timestamp.timetuple()),
loc=last_read_location,
@ -259,7 +259,7 @@ class KINDLE(USBMS):
typ=user_notes[location]['type']))
for annotation in annotations:
divTag.insert(dtc, annotation)
divTag.insert(dtc, BeautifulSoup(annotation))
dtc += 1
ka_soup.insert(0,divTag)

View File

@ -76,7 +76,7 @@ class KOBO(USBMS):
dbversion = 0
fwversion = (0,0,0)
supported_dbversion = 146
supported_dbversion = 147
has_kepubs = False
supported_platforms = ['windows', 'osx', 'linux']
@ -1201,13 +1201,13 @@ class KOBO(USBMS):
spanTag = Tag(ka_soup, 'span')
spanTag['style'] = 'font-weight:normal'
if bookmark.book_format == 'epub':
spanTag.insert(0,NavigableString(
spanTag.insert(0,BeautifulSoup(
_("<hr /><b>Book last read:</b> %(time)s<br /><b>Percentage read:</b> %(pr)d%%<hr />") % dict(
time=last_read,
# loc=last_read_location,
pr=percent_read)))
else:
spanTag.insert(0,NavigableString(
spanTag.insert(0,BeautifulSoup(
_("<hr /><b>Book last read:</b> %(time)s<br /><b>Percentage read:</b> %(pr)d%%<hr />") % dict(
time=last_read,
# loc=last_read_location,
@ -1270,7 +1270,7 @@ class KOBO(USBMS):
annotation=user_notes[location]['annotation']))
for annotation in annotations:
divTag.insert(dtc, annotation)
divTag.insert(dtc, BeautifulSoup(annotation))
dtc += 1
ka_soup.insert(0,divTag)
@ -1322,7 +1322,7 @@ class KOBOTOUCH(KOBO):
' Based on the existing Kobo driver by %s.') % KOBO.author
# icon = I('devices/kobotouch.jpg')
supported_dbversion = 146
supported_dbversion = 147
min_supported_dbversion = 53
min_dbversion_series = 65
min_dbversion_externalid = 65
@ -1334,7 +1334,7 @@ class KOBOTOUCH(KOBO):
# Starting with firmware version 3.19.x, the last number appears to be is a
# build number. A number will be recorded here but it can be safely ignored
# when testing the firmware version.
max_supported_fwversion = (4, 8, 11073)
max_supported_fwversion = (4, 9, 11314)
# The following document firwmare versions where new function or devices were added.
# Not all are used, but this feels a good place to record it.
min_fwversion_shelves = (2, 0, 0)