* src/GrampsBSDDB.py: fix remove_person and count_person

* src/GrampsInMemDB.py: fix remove_person and count_person


svn: r3566
This commit is contained in:
Don Allingham 2004-09-21 03:17:07 +00:00
parent 523a3b3943
commit 3ab1e97227
3 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,7 @@
2004-09-20 Don Allingham <dallingham@users.sourceforge.net>
* src/GrampsBSDDB.py: fix remove_person and count_person
* src/GrampsInMemDB.py: fix remove_person and count_person
2004-09-20 Alex Roitman <shura@alex.neuro.umn.edu> 2004-09-20 Alex Roitman <shura@alex.neuro.umn.edu>
* src/DateEdit.py (DateEdit.invoke_date_editor): * src/DateEdit.py (DateEdit.invoke_date_editor):
Check the built date and display LED (closes # 1031065). Check the built date and display LED (closes # 1031065).

View File

@ -172,11 +172,11 @@ class GrampsBSDDB(GrampsDbBase):
return vals return vals
def remove_person(self,handle,transaction): def remove_person(self,handle,transaction):
self.genderStats.uncount_person (self.person_map[handle]) person = self.get_person_from_handle(handle)
self.genderStats.uncount_person (person)
if transaction != None: if transaction != None:
old_data = self.person_map.get(handle) transaction.add(PERSON_KEY,handle,person.serialize())
transaction.add(PERSON_KEY,handle,old_data) self.person_map.delete(str(handle))
self.person_map.delete(handle)
def remove_source(self,handle,transaction): def remove_source(self,handle,transaction):
if transaction != None: if transaction != None:
@ -200,7 +200,7 @@ class GrampsBSDDB(GrampsDbBase):
if transaction != None: if transaction != None:
old_data = self.place_map.get(handle) old_data = self.place_map.get(handle)
transaction.add(PLACE_KEY,handle,old_data) transaction.add(PLACE_KEY,handle,old_data)
self.place_map.delete(handle) self.place_map.delete(str(handle))
def get_person_from_gramps_id(self,val): def get_person_from_gramps_id(self,val):
"""finds a Person in the database from the passed gramps' ID. """finds a Person in the database from the passed gramps' ID.

View File

@ -79,7 +79,8 @@ class GrampsInMemDB(GrampsDbBase):
return vals return vals
def remove_person(self,handle,transaction): def remove_person(self,handle,transaction):
self.genderStats.uncount_person (self.person_map[handle]) person = self.get_person_from_handle(handle)
self.genderStats.uncount_person (person)
if transaction != None: if transaction != None:
old_data = self.person_map.get(handle) old_data = self.person_map.get(handle)
transaction.add(PERSON_KEY,handle,old_data) transaction.add(PERSON_KEY,handle,old_data)