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> 2007-10-11 Don Allingham <don@gramps-project.org>
* src/DisplayState.py: fix callback references * src/DisplayState.py: fix callback references
* src/DbState.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)] > result_list = [i for i in find_backlink_handles(handle)]
""" """
# Use the secondary index to locate all the reference_map entries # Use the secondary index to locate all the reference_map entries
# that include a reference to the object we are looking for. # that include a reference to the object we are looking for.
referenced_cur = self.get_reference_map_referenced_cursor() referenced_cur = self.get_reference_map_referenced_cursor()
@ -1345,6 +1344,9 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback):
self.event_map.sync() self.event_map.sync()
def set_name_group_mapping(self, name, group): 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: try:
self.__set_name_group_mapping(name, group) self.__set_name_group_mapping(name, group)
except DBERRS, msg: except DBERRS, msg:
@ -1359,11 +1361,11 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback):
else: else:
the_txn = None the_txn = None
name = str(name) name = str(name)
data = self.name_group.get(name,txn=the_txn) data = self.name_group.get(name, txn=the_txn)
if not group and data: if data is not None:
self.name_group.delete(name,txn=the_txn) self.name_group.delete(name, txn=the_txn)
else: if group is not None:
self.name_group.put(name,group,txn=the_txn) self.name_group.put(name, group, txn=the_txn)
if self.UseTXN: if self.UseTXN:
the_txn.commit() the_txn.commit()
else: else: