From 3a82e3e0333490ca6f35176bfeca4cfe9e55762c Mon Sep 17 00:00:00 2001 From: John Schember Date: Sat, 24 May 2014 23:57:30 -0400 Subject: [PATCH] Convert old accurate bool setting to new string method. --- src/calibre/devices/kindle/driver.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/calibre/devices/kindle/driver.py b/src/calibre/devices/kindle/driver.py index a36d3df112..ce6fff9b2a 100644 --- a/src/calibre/devices/kindle/driver.py +++ b/src/calibre/devices/kindle/driver.py @@ -340,6 +340,16 @@ class KINDLE2(KINDLE): THUMBNAIL_HEIGHT = 330 # 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): ans = USBMS.formats_to_scan_for(self) | {'azw3'} return ans