From f09c32181ad8d0410e6175d8d5153d09cf4fb8bd Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 16 Apr 2016 18:25:21 -0400 Subject: [PATCH] DB-API: fix version --- gramps/cli/clidbman.py | 5 ++++- gramps/gen/db/generic.py | 2 ++ gramps/plugins/database/dbapi.py | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gramps/cli/clidbman.py b/gramps/cli/clidbman.py index 64e94de8d..4827d5306 100644 --- a/gramps/cli/clidbman.py +++ b/gramps/cli/clidbman.py @@ -229,7 +229,10 @@ class CLIDbManager(object): version = open(os.path.join(dirpath, "bdbversion.txt")).read() except: version = "(0, 0, 0)" - version = ast.literal_eval(version) + try: + version = ast.literal_eval(version) + except: + version = (0, 0, 0) if os.path.isfile(path_name): file = open(path_name, 'r', encoding='utf8') name = file.readline().strip() diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index 268a3d204..0481339ee 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -430,6 +430,8 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): __callback_map = {} + VERSION = (18, 0, 0) + def __init__(self, directory=None): DbReadBase.__init__(self) DbWriteBase.__init__(self) diff --git a/gramps/plugins/database/dbapi.py b/gramps/plugins/database/dbapi.py index ff07409bb..1436cb383 100644 --- a/gramps/plugins/database/dbapi.py +++ b/gramps/plugins/database/dbapi.py @@ -40,7 +40,6 @@ class DBAPI(DbGeneric): """ Database backends class for DB-API 2.0 databases """ - VERSION = (18, 0, 0) def restore(self): """