Remove version from the database type column

The version is still available in the information dialog and
from the command line.
This commit is contained in:
Nick Hall 2017-08-20 19:29:14 +01:00
parent bb8a214c68
commit 1d5788bb2d
2 changed files with 5 additions and 16 deletions

View File

@ -191,7 +191,7 @@ class CLIDbManager:
print(_('Gramps Family Trees:')) print(_('Gramps Family Trees:'))
for item in self.current_names: for item in self.current_names:
(name, dirpath, path_name, last, (name, dirpath, path_name, last,
tval, enable, stock_id, backend_type, version) = item tval, enable, stock_id, backend_type) = item
if (database_names is None or if (database_names is None or
any([(re.match("^" + dbname + "$", name) or any([(re.match("^" + dbname + "$", name) or
dbname == name) dbname == name)
@ -213,7 +213,7 @@ class CLIDbManager:
summary_list = [] summary_list = []
for item in self.current_names: for item in self.current_names:
(name, dirpath, path_name, last, (name, dirpath, path_name, last,
tval, enable, stock_id, backend_type, version) = item tval, enable, stock_id, backend_type) = item
if (database_names is None or if (database_names is None or
any([(re.match("^" + dbname + "$", name) or any([(re.match("^" + dbname + "$", name) or
dbname == name) dbname == name)
@ -240,15 +240,6 @@ class CLIDbManager:
backend_type = file.read() backend_type = file.read()
except: except:
backend_type = "bsddb" backend_type = "bsddb"
try:
with open(os.path.join(dirpath, "bdbversion.txt")) as file:
version = file.read()
except:
version = "(0, 0, 0)"
try:
version = ast.literal_eval(version)
except:
version = (0, 0, 0)
if os.path.isfile(path_name): if os.path.isfile(path_name):
with open(path_name, 'r', encoding='utf8') as file: with open(path_name, 'r', encoding='utf8') as file:
name = file.readline().strip() name = file.readline().strip()
@ -262,7 +253,7 @@ class CLIDbManager:
self.current_names.append( self.current_names.append(
(name, os.path.join(dbdir, dpath), path_name, (name, os.path.join(dbdir, dpath), path_name,
last, tval, enable, stock_id, backend_type, version)) last, tval, enable, stock_id, backend_type))
self.current_names.sort() self.current_names.sort()

View File

@ -422,9 +422,7 @@ class DbManager(CLIDbManager, ManagedWindow):
for items in self.current_names: for items in self.current_names:
data = list(items[:8]) data = list(items[:8])
backend_type = self.get_backend_name_from_dbid(data[BACKEND_COL]) backend_type = self.get_backend_name_from_dbid(data[BACKEND_COL])
version = str(".".join([str(v) for v in items[8]])) node = self.model.append(None, data[:-1] + [backend_type])
node = self.model.append(None, data[:-1] + [backend_type + ", "
+ version])
# For already loaded database, set current_node: # For already loaded database, set current_node:
if self.dbstate.is_open() and \ if self.dbstate.is_open() and \
self.dbstate.db.get_save_path() == data[1]: self.dbstate.db.get_save_path() == data[1]:
@ -434,7 +432,7 @@ class DbManager(CLIDbManager, ManagedWindow):
last_accessed_node = node last_accessed_node = node
for rdata in find_revisions(os.path.join(items[1], ARCHIVE_V)): for rdata in find_revisions(os.path.join(items[1], ARCHIVE_V)):
data = [rdata[2], rdata[0], items[1], rdata[1], 0, False, "", data = [rdata[2], rdata[0], items[1], rdata[1], 0, False, "",
backend_type + ", " + version] backend_type]
self.model.append(node, data) self.model.append(node, data)
if self._current_node is None: if self._current_node is None:
self._current_node = last_accessed_node self._current_node = last_accessed_node