* src/GrampsBSDDB.py: change rebuilding of secondary indices
to use keys instead of cursors. svn: r5452
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2005-11-29 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/GrampsBSDDB.py: change rebuilding of secondary indices
|
||||||
|
to use keys instead of cursors.
|
||||||
|
|
||||||
2005-11-29 Julio Sanchez <jsanchez@users.sourceforge.net>
|
2005-11-29 Julio Sanchez <jsanchez@users.sourceforge.net>
|
||||||
* NEWS: Better support for media objects in GEDCOM output
|
* NEWS: Better support for media objects in GEDCOM output
|
||||||
|
|
||||||
|
@ -225,15 +225,10 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
self.person_map.associate(self.surnames, find_surname, db.DB_CREATE)
|
self.person_map.associate(self.surnames, find_surname, db.DB_CREATE)
|
||||||
self.person_map.associate(self.id_trans, find_idmap, db.DB_CREATE)
|
self.person_map.associate(self.id_trans, find_idmap, db.DB_CREATE)
|
||||||
|
|
||||||
cursor = self.get_person_cursor()
|
for key in self.person_map.keys():
|
||||||
data = cursor.first()
|
|
||||||
while data:
|
|
||||||
if callback:
|
if callback:
|
||||||
callback()
|
callback()
|
||||||
self.person_map[data[0]] = data[1]
|
self.person_map[key] = self.person_map[key]
|
||||||
data = cursor.next()
|
|
||||||
cursor.close()
|
|
||||||
|
|
||||||
self.person_map.sync()
|
self.person_map.sync()
|
||||||
|
|
||||||
# Repair secondary indices related to family_map
|
# Repair secondary indices related to family_map
|
||||||
@ -246,15 +241,10 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
self.fid_trans.truncate()
|
self.fid_trans.truncate()
|
||||||
self.family_map.associate(self.fid_trans, find_idmap, db.DB_CREATE)
|
self.family_map.associate(self.fid_trans, find_idmap, db.DB_CREATE)
|
||||||
|
|
||||||
|
for key in self.family_map.keys():
|
||||||
cursor = self.get_family_cursor()
|
|
||||||
data = cursor.first()
|
|
||||||
while data:
|
|
||||||
if callback:
|
if callback:
|
||||||
callback()
|
callback()
|
||||||
self.family_map[data[0]] = data[1]
|
self.family_map[key] = self.family_map[key]
|
||||||
data = cursor.next()
|
|
||||||
cursor.close()
|
|
||||||
self.family_map.sync()
|
self.family_map.sync()
|
||||||
|
|
||||||
# Repair secondary indices related to place_map
|
# Repair secondary indices related to place_map
|
||||||
@ -267,14 +257,10 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
self.pid_trans.truncate()
|
self.pid_trans.truncate()
|
||||||
self.place_map.associate(self.pid_trans, find_idmap, db.DB_CREATE)
|
self.place_map.associate(self.pid_trans, find_idmap, db.DB_CREATE)
|
||||||
|
|
||||||
cursor = self.get_place_cursor()
|
for key in self.place_map.keys():
|
||||||
data = cursor.first()
|
|
||||||
while data:
|
|
||||||
if callback:
|
if callback:
|
||||||
callback()
|
callback()
|
||||||
self.place_map[data[0]] = data[1]
|
self.place_map[key] = self.place_map[key]
|
||||||
data = cursor.next()
|
|
||||||
cursor.close()
|
|
||||||
self.place_map.sync()
|
self.place_map.sync()
|
||||||
|
|
||||||
# Repair secondary indices related to media_map
|
# Repair secondary indices related to media_map
|
||||||
@ -287,14 +273,10 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
self.oid_trans.truncate()
|
self.oid_trans.truncate()
|
||||||
self.media_map.associate(self.oid_trans, find_idmap, db.DB_CREATE)
|
self.media_map.associate(self.oid_trans, find_idmap, db.DB_CREATE)
|
||||||
|
|
||||||
cursor = self.get_media_cursor()
|
for key in self.media_map.keys():
|
||||||
data = cursor.first()
|
|
||||||
while data:
|
|
||||||
if callback:
|
if callback:
|
||||||
callback()
|
callback()
|
||||||
self.media_map[data[0]] = data[1]
|
self.media_map[key] = self.media_map[key]
|
||||||
data = cursor.next()
|
|
||||||
cursor.close()
|
|
||||||
self.media_map.sync()
|
self.media_map.sync()
|
||||||
|
|
||||||
# Repair secondary indices related to source_map
|
# Repair secondary indices related to source_map
|
||||||
@ -307,14 +289,10 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
self.sid_trans.truncate()
|
self.sid_trans.truncate()
|
||||||
self.source_map.associate(self.sid_trans, find_idmap, db.DB_CREATE)
|
self.source_map.associate(self.sid_trans, find_idmap, db.DB_CREATE)
|
||||||
|
|
||||||
cursor = self.get_source_cursor()
|
for key in self.source_map.keys():
|
||||||
data = cursor.first()
|
|
||||||
while data:
|
|
||||||
if callback:
|
if callback:
|
||||||
callback()
|
callback()
|
||||||
self.source_map[data[0]] = data[1]
|
self.source_map[key] = self.source_map[key]
|
||||||
data = cursor.next()
|
|
||||||
cursor.close()
|
|
||||||
self.source_map.sync()
|
self.source_map.sync()
|
||||||
|
|
||||||
def abort_changes(self):
|
def abort_changes(self):
|
||||||
|
Reference in New Issue
Block a user