From 2159a2de8508f67457bde1fa1dcaac8f840bfbb3 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Mon, 19 Jul 2010 10:22:07 +0100 Subject: [PATCH] More for moving preferences to the DB --- src/calibre/library/database2.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index c26a4b96f3..f1d8ac69e2 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -148,16 +148,13 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): ans = self.prefs.get(name, None) if ans is None: ans = prefs[name] - try: - del prefs[name] - except: - pass - if ans is not None: - self.prefs[name] = ans + if ans is None: + raise ValueError('Preference %s is None!'%name) + prefs[name] = '###OBSOLETE--DON\'T USE ME###' + self.prefs[name] = ans migrate_preference('user_categories') migrate_preference('saved_searches') - set_saved_searches(self, 'saved_searches') self.conn.executescript('''