* src/GrampsBSDDB.py: actually perform the commits during the

transaction_commit task, instead of the commit_* tasks
* src/GrampsInMem.py: actually perform the commits during the
transaction_commit task, instead of the commit_* tasks
* src/GrampsDbBase.py: actually perform the commits during the
transaction_commit task, instead of the commit_* tasks


svn: r4370
This commit is contained in:
Don Allingham 2005-04-17 22:34:56 +00:00
parent 958e07cace
commit e063c81249
4 changed files with 348 additions and 444 deletions

View File

@ -1,3 +1,11 @@
2005-04-17 Don Allingham <don@gramps-project.org>
* src/GrampsBSDDB.py: actually perform the commits during the
transaction_commit task, instead of the commit_* tasks
* src/GrampsInMem.py: actually perform the commits during the
transaction_commit task, instead of the commit_* tasks
* src/GrampsDbBase.py: actually perform the commits during the
transaction_commit task, instead of the commit_* tasks
2005-04-17 Eero Tamminen <eerot@sf>
* src/gramps.glade: Fix typo
* src/GenericFilter.py: Fix typo

View File

@ -246,6 +246,24 @@ class GrampsBSDDB(GrampsDbBase):
self.env = None
self.metadata = None
def _del_person(self,handle):
self.person_map.delete(str(handle))
def _del_source(self,handle):
self.source_map.delete(str(handle))
def _del_place(self,handle):
self.place_map.delete(str(handle))
def _del_media(self,handle):
self.media_map.delete(str(handle))
def _del_family(self,handle):
self.family_map.delete(str(handle))
def _del_event(self,handle):
self.event_map.delete(str(handle))
def set_name_group_mapping(self,name,group):
if not self.readonly:
name = str(name)
@ -273,54 +291,6 @@ class GrampsBSDDB(GrampsDbBase):
vals.sort()
return vals
def remove_person(self,handle,transaction):
if not self.readonly:
person = self.get_person_from_handle(handle)
self.genderStats.uncount_person (person)
if transaction != None:
transaction.add(PERSON_KEY,handle,person.serialize())
self.emit('person-delete',([str(handle)],))
self.person_map.delete(str(handle))
def remove_source(self,handle,transaction):
if not self.readonly:
if transaction != None:
old_data = self.source_map.get(str(handle))
transaction.add(SOURCE_KEY,handle,old_data)
self.emit('source-delete',([handle],))
self.source_map.delete(str(handle))
def remove_family(self,handle,transaction):
if not self.readonly:
if transaction != None:
old_data = self.family_map.get(str(handle))
transaction.add(FAMILY_KEY,handle,old_data)
self.emit('family-delete',([str(handle)],))
self.family_map.delete(str(handle))
def remove_event(self,handle,transaction):
if not self.readonly:
if transaction != None:
old_data = self.event_map.get(str(handle))
transaction.add(EVENT_KEY,handle,old_data)
self.event_map.delete(str(handle))
def remove_place(self,handle,transaction):
if not self.readonly:
if transaction != None:
old_data = self.place_map.get(handle)
transaction.add(PLACE_KEY,handle,old_data)
self.emit('place-delete',([handle],))
self.place_map.delete(str(handle))
def remove_object(self,handle,transaction):
if not self.readonly:
if transaction != None:
old_data = self.media_map.get(handle)
transaction.add(PLACE_KEY,handle,old_data)
self.emit('media-delete',([handle],))
self.media_map.delete(str(handle))
def get_person_from_gramps_id(self,val):
"""finds a Person in the database from the passed gramps' ID.
If no such Person exists, a new Person is added to the database."""

File diff suppressed because it is too large Load Diff

View File

@ -134,67 +134,27 @@ class GrampsInMemDB(GrampsDbBase):
vals.sort()
return vals
def remove_person(self,handle,transaction):
if self.readonly:
return
person = self.get_person_from_handle(handle)
self.genderStats.uncount_person (person)
if transaction != None:
old_data = self.person_map.get(handle)
transaction.add(PERSON_KEY,handle,old_data)
self.emit('person-delete',([handle],))
def _del_person(self,handle):
del self.id_trans[person.get_gramps_id()]
del self.person_map[handle]
def remove_source(self,handle,transaction):
if self.readonly:
return
source = self.get_source_from_handle(handle)
if transaction != None:
old_data = self.source_map.get(str(handle))
transaction.add(SOURCE_KEY,handle,old_data)
self.emit('source-delete',([handle],))
def _del_source(self,handle):
del self.sid_trans[source.get_gramps_id()]
del self.source_map[str(handle)]
def remove_place(self,handle,transaction):
if self.readonly:
return
place = self.get_place_from_handle(handle)
if transaction != None:
old_data = self.place_map.get(str(handle))
transaction.add(PLACE_KEY,handle,old_data)
self.emit('person-delete',([handle],))
def _del_place(self,handle):
del self.pid_trans[place.get_gramps_id()]
del self.place_map[str(handle)]
def remove_object(self,handle,transaction):
if self.readonly:
return
obj = self.get_object_from_handle(handle)
if transaction != None:
old_data = self.media_map.get(str(handle))
transaction.add(MEDIA_KEY,handle,old_data)
def _del_media(self,handle):
del self.oid_trans[obj.get_gramps_id()]
del self.media_map[str(handle)]
def remove_family(self,handle,transaction):
if self.readonly:
return
family = self.get_family_from_handle(handle)
if transaction != None:
old_data = self.family_map.get(str(handle))
transaction.add(FAMILY_KEY,handle,old_data)
self.emit('family-delete',([str(handle),]))
def _del_family(self,handle):
del self.fid_trans[family.get_gramps_id()]
del self.family_map[str(handle)]
def remove_event(self,handle,transaction):
if self.readonly:
return
if transaction != None:
old_data = self.event_map.get(str(handle))
transaction.add(EVENT_KEY,handle,old_data)
def _del_event(self,handle):
del self.event_map[str(handle)]
def commit_person(self,person,transaction,change_time=None):