Convert old accurate bool setting to new string method.

This commit is contained in:
John Schember 2014-05-24 23:57:30 -04:00
parent e82b80497f
commit 3a82e3e033

View File

@ -340,6 +340,16 @@ class KINDLE2(KINDLE):
THUMBNAIL_HEIGHT = 330 THUMBNAIL_HEIGHT = 330
# x262 on the Touch. Doesn't choke on x330, though. # x262 on the Touch. Doesn't choke on x330, though.
def settings(self):
s = super(KINDLE, self).settings()
# Previous versions used OPT_APNX_ACCURATE as a bool to enable accurate apnx algorithm.
# Later versions changed to OPT_APNX_ACCURATE_METHOD which takes a string representing
# the algorithm to use. Convert any stored bool values to accurate or fast which were
# the previous meanings of bool.
if isinstance(s[self.OPT_APNX_ACCURATE_METHOD], bool):
s[self.OPT_APNX_ACCURATE_METHOD] = 'accurate' if s[self.OPT_APNX_ACCURATE_METHOD] else 'fast'
return s
def formats_to_scan_for(self): def formats_to_scan_for(self):
ans = USBMS.formats_to_scan_for(self) | {'azw3'} ans = USBMS.formats_to_scan_for(self) | {'azw3'}
return ans return ans