From f0fbb72dc4fa01d8b1b57c315adfc0d92c4c902e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 21 Sep 2004 03:17:07 +0000 Subject: [PATCH] * src/GrampsBSDDB.py: fix remove_person and count_person * src/GrampsInMemDB.py: fix remove_person and count_person svn: r3566 --- ChangeLog | 4 ++++ src/GrampsBSDDB.py | 10 +++++----- src/GrampsInMemDB.py | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2c086e00..5d6af92e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-09-20 Don Allingham + * src/GrampsBSDDB.py: fix remove_person and count_person + * src/GrampsInMemDB.py: fix remove_person and count_person + 2004-09-20 Alex Roitman * src/DateEdit.py (DateEdit.invoke_date_editor): Check the built date and display LED (closes # 1031065). diff --git a/src/GrampsBSDDB.py b/src/GrampsBSDDB.py index 9b0b25393..66cffb0f2 100644 --- a/src/GrampsBSDDB.py +++ b/src/GrampsBSDDB.py @@ -172,11 +172,11 @@ class GrampsBSDDB(GrampsDbBase): return vals 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: - old_data = self.person_map.get(handle) - transaction.add(PERSON_KEY,handle,old_data) - self.person_map.delete(handle) + transaction.add(PERSON_KEY,handle,person.serialize()) + self.person_map.delete(str(handle)) def remove_source(self,handle,transaction): if transaction != None: @@ -200,7 +200,7 @@ class GrampsBSDDB(GrampsDbBase): if transaction != None: old_data = self.place_map.get(handle) 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): """finds a Person in the database from the passed gramps' ID. diff --git a/src/GrampsInMemDB.py b/src/GrampsInMemDB.py index 38476cb3a..a2d6b05c5 100644 --- a/src/GrampsInMemDB.py +++ b/src/GrampsInMemDB.py @@ -79,7 +79,8 @@ class GrampsInMemDB(GrampsDbBase): return vals 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: old_data = self.person_map.get(handle) transaction.add(PERSON_KEY,handle,old_data)