Prevent bsddb from being selected/used

This commit is contained in:
prculley 2020-01-31 10:10:02 -06:00 committed by Paul Culley
parent ae66ada99c
commit aeed7edd46
3 changed files with 6 additions and 2 deletions

View File

@ -369,3 +369,5 @@ if not os.path.exists(CONFIGMAN.filename):
CONFIGMAN.load()
config = CONFIGMAN
if config.get('database.backend') == 'bsddb':
config.set('database.backend', 'sqlite')

View File

@ -1809,6 +1809,8 @@ class GrampsPreferences(ConfigureDialog):
for plugin in sorted(backend_plugins, key=lambda plugin: plugin.name):
if plugin.id == default:
active = count
if plugin.id == 'bsddb':
continue # bsddb is deprecated, so don't allow setting
model.append(row=[count, plugin.name, plugin.id])
count += 1
obox.set_model(model)

View File

@ -367,7 +367,7 @@ class DbManager(CLIDbManager, ManagedWindow):
dbid = config.get('database.backend')
backend_type = self.get_backend_name_from_dbid(dbid)
if backend_type == UNAVAILABLE:
dbid = 'bsddb'
dbid = 'sqlite'
config.set('database.backend', dbid)
backend_type = self.get_backend_name_from_dbid(dbid)
self.new_btn.set_tooltip_text(backend_type)
@ -938,7 +938,7 @@ class DbManager(CLIDbManager, ManagedWindow):
fname = os.path.join(dirname, filename)
os.unlink(fname)
dbase = make_database("bsddb")
dbase = make_database("sqlite")
dbase.load(dirname, None)
self.__start_cursor(_("Rebuilding database from backup files"))