2007-10-12 Benny Malengier <benny.malengier@gramps-project.org>

* src/gen/db/dbdir.py: do name group change from GrampsBSDDB to dbdir.


svn: r9159
This commit is contained in:
Benny Malengier 2007-10-12 10:37:19 +00:00
parent f0c2940c04
commit 1add2aa37b
2 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,6 @@
2007-10-12 Benny Malengier <benny.malengier@gramps-project.org>
* src/gen/db/dbdir.py: do name group change from GrampsBSDDB to dbdir.
2007-10-11 Don Allingham <don@gramps-project.org>
* src/DisplayState.py: fix callback references
* src/DbState.py: fix callback references

View File

@ -839,7 +839,6 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback):
> result_list = [i for i in find_backlink_handles(handle)]
"""
# Use the secondary index to locate all the reference_map entries
# that include a reference to the object we are looking for.
referenced_cur = self.get_reference_map_referenced_cursor()
@ -1345,6 +1344,9 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback):
self.event_map.sync()
def set_name_group_mapping(self, name, group):
"""Make name group under the value of group.
If group =None, the old grouping is deleted
"""
try:
self.__set_name_group_mapping(name, group)
except DBERRS, msg:
@ -1359,11 +1361,11 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback):
else:
the_txn = None
name = str(name)
data = self.name_group.get(name,txn=the_txn)
if not group and data:
self.name_group.delete(name,txn=the_txn)
else:
self.name_group.put(name,group,txn=the_txn)
data = self.name_group.get(name, txn=the_txn)
if data is not None:
self.name_group.delete(name, txn=the_txn)
if group is not None:
self.name_group.put(name, group, txn=the_txn)
if self.UseTXN:
the_txn.commit()
else: