From 47bd113d2d8f56b5c4ffe241bc4712062bbac945 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Mon, 25 Jun 2007 16:10:10 +0000 Subject: [PATCH] 2007-06-25 Alex Roitman * src/GrampsDb/_GrampsDBDir.py (commit_base): Rename method. * src/GrampsDb/_GrampsDbBase.py: Rename __commit_base into commit base: caused problems with python2.4 scoping. svn: r8665 --- ChangeLog | 5 +++++ src/GrampsDb/_GrampsDBDir.py | 3 ++- src/GrampsDb/_GrampsDbBase.py | 19 ++++++++++--------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdf4be3d4..213d83298 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-25 Alex Roitman + * src/GrampsDb/_GrampsDBDir.py (commit_base): Rename method. + * src/GrampsDb/_GrampsDbBase.py: Rename __commit_base into commit + base: caused problems with python2.4 scoping. + 2007-06-24 Alex Roitman * src/NameDisplay.py (_gen_cooked_func,_gen_raw_func): Do not replace %% with anything. diff --git a/src/GrampsDb/_GrampsDBDir.py b/src/GrampsDb/_GrampsDBDir.py index 8ace96d19..94de3e515 100644 --- a/src/GrampsDb/_GrampsDBDir.py +++ b/src/GrampsDb/_GrampsDBDir.py @@ -1472,12 +1472,13 @@ class GrampsDBDir(GrampsDbBase,UpdateCallback): return self.__get_obj_from_gramps_id(val,self.nid_trans,Note, self.note_map) - def __commit_base(self, obj, data_map, key, update_list, add_list, + def commit_base(self, obj, data_map, key, update_list, add_list, transaction, change_time): """ Commits the specified object to the database, storing the changes as part of the transaction. """ + print "There" if self.readonly or not obj or not obj.handle: return diff --git a/src/GrampsDb/_GrampsDbBase.py b/src/GrampsDb/_GrampsDbBase.py index 1042439bb..ed2e556b2 100644 --- a/src/GrampsDb/_GrampsDbBase.py +++ b/src/GrampsDb/_GrampsDbBase.py @@ -420,12 +420,13 @@ class GrampsDbBase(GrampsDBCallback): self.emit('repository-rebuild') self.emit('note-rebuild') - def __commit_base(self, obj, data_map, key, update_list, add_list, + def commit_base(self, obj, data_map, key, update_list, add_list, transaction, change_time): """ Commits the specified Person to the database, storing the changes as part of the transaction. """ + print "HERE" if self.readonly or not obj or not obj.handle: return @@ -464,7 +465,7 @@ class GrampsDbBase(GrampsDBCallback): as part of the transaction. """ - old_data = self.__commit_base( + old_data = self.commit_base( person, self.person_map, PERSON_KEY, transaction.person_update, transaction.person_add, transaction, change_time) if old_data: @@ -511,7 +512,7 @@ class GrampsDbBase(GrampsDBCallback): as part of the transaction. """ - self.__commit_base(obj, self.media_map, MEDIA_KEY, + self.commit_base(obj, self.media_map, MEDIA_KEY, transaction.media_update, transaction.media_add, transaction, change_time) self.media_attributes.update( @@ -524,7 +525,7 @@ class GrampsDbBase(GrampsDBCallback): as part of the transaction. """ - self.__commit_base(source, self.source_map, SOURCE_KEY, + self.commit_base(source, self.source_map, SOURCE_KEY, transaction.source_update, transaction.source_add, transaction, change_time) @@ -544,7 +545,7 @@ class GrampsDbBase(GrampsDBCallback): as part of the transaction. """ - self.__commit_base(place, self.place_map, PLACE_KEY, + self.commit_base(place, self.place_map, PLACE_KEY, transaction.place_update, transaction.place_add, transaction, change_time) @@ -572,7 +573,7 @@ class GrampsDbBase(GrampsDBCallback): Commits the specified Event to the database, storing the changes as part of the transaction. """ - self.__commit_base(event, self.event_map, EVENT_KEY, + self.commit_base(event, self.event_map, EVENT_KEY, transaction.event_update, transaction.event_add, transaction, change_time) @@ -588,7 +589,7 @@ class GrampsDbBase(GrampsDBCallback): as part of the transaction. """ - self.__commit_base(family, self.family_map, FAMILY_KEY, + self.commit_base(family, self.family_map, FAMILY_KEY, transaction.family_update, transaction.family_add, transaction, change_time) @@ -623,7 +624,7 @@ class GrampsDbBase(GrampsDBCallback): as part of the transaction. """ - self.__commit_base(repository, self.repository_map, REPOSITORY_KEY, + self.commit_base(repository, self.repository_map, REPOSITORY_KEY, transaction.repository_update, transaction.repository_add, transaction, change_time) @@ -643,7 +644,7 @@ class GrampsDbBase(GrampsDBCallback): import traceback traceback.print_stack() - self.__commit_base(note, self.note_map, NOTE_KEY, + self.commit_base(note, self.note_map, NOTE_KEY, transaction.note_update, transaction.note_add, transaction, change_time)