From ba6a1314894da1c395fb6d3f44f0017cccbcee50 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sun, 21 May 2006 18:17:52 +0000 Subject: [PATCH] 2006-05-21 Alex Roitman * src/DisplayTabs/_PersonEventEmbedList.py (PersonEventEmbedList.default_type): properly process event list. * src/Editors/_EditEventRef.py (EditEventRef.get_custom_events): Use correct method. * src/Editors/_EditEvent.py (EditEvent.get_custom_events) (EditPersonEvent.get_custom_events): Use correct method. * src/GrampsDb/_GrampsDbBase.py: Remove obsolete methods. * src/GrampsDb/_GrampsInMemDB.py: Remove obsolete methods. svn: r6735 --- gramps2/ChangeLog | 10 ++++++++++ .../src/DisplayTabs/_PersonEventEmbedList.py | 6 +++++- gramps2/src/Editors/_EditEvent.py | 4 ++-- gramps2/src/Editors/_EditEventRef.py | 2 +- gramps2/src/GrampsDb/_GrampsDbBase.py | 7 ------- gramps2/src/GrampsDb/_GrampsInMemDB.py | 19 ------------------- 6 files changed, 18 insertions(+), 30 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 716f6c114..a71efd037 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,13 @@ +2006-05-21 Alex Roitman + * src/DisplayTabs/_PersonEventEmbedList.py + (PersonEventEmbedList.default_type): properly process event list. + * src/Editors/_EditEventRef.py (EditEventRef.get_custom_events): + Use correct method. + * src/Editors/_EditEvent.py (EditEvent.get_custom_events) + (EditPersonEvent.get_custom_events): Use correct method. + * src/GrampsDb/_GrampsDbBase.py: Remove obsolete methods. + * src/GrampsDb/_GrampsInMemDB.py: Remove obsolete methods. + 2006-05-20 Don Allingham * src/Editors/_EditPlace.py: custom menus * src/Editors/_EditLdsOrd.py: custom menus diff --git a/gramps2/src/DisplayTabs/_PersonEventEmbedList.py b/gramps2/src/DisplayTabs/_PersonEventEmbedList.py index 1938d6b2a..fac555c64 100644 --- a/gramps2/src/DisplayTabs/_PersonEventEmbedList.py +++ b/gramps2/src/DisplayTabs/_PersonEventEmbedList.py @@ -64,8 +64,12 @@ class PersonEventEmbedList(EventEmbedList): def default_type(self): type_list = [] - ref_list = [ ref for ref in self.return_info() if ref ] + # combine return info into a single flat sequence + ri = self.return_info() + ri = ri[0:2] + tuple(ri[2]) + ref_list = [ ref for ref in ri if ref] + event = None for event_ref in ref_list: event = self.dbstate.db.get_event_from_handle(event_ref.ref) diff --git a/gramps2/src/Editors/_EditEvent.py b/gramps2/src/Editors/_EditEvent.py index 84ed257c2..d46f20ce1 100644 --- a/gramps2/src/Editors/_EditEvent.py +++ b/gramps2/src/Editors/_EditEvent.py @@ -82,7 +82,7 @@ class EditEvent(EditPrimary): return RelLib.Event() def get_custom_events(self): - return self.dbstate.db.get_person_event_type_list() + \ + return self.dbstate.db.get_person_event_types() + \ self.dbstate.db.get_family_event_types() def _local_init(self): @@ -238,7 +238,7 @@ class EditPersonEvent(EditEvent): self.commit_event = self.db.commit_personal_event def get_custom_events(self): - return self.dbstate.db.get_person_event_type_list() + return self.dbstate.db.get_person_event_types() class EditFamilyEvent(EditEvent): diff --git a/gramps2/src/Editors/_EditEventRef.py b/gramps2/src/Editors/_EditEventRef.py index f9fb88787..a58871838 100644 --- a/gramps2/src/Editors/_EditEventRef.py +++ b/gramps2/src/Editors/_EditEventRef.py @@ -85,7 +85,7 @@ class EditEventRef(EditReference): self.add_event = self.db.add_person_event def get_custom_events(self): - return self.db.get_person_event_type_list() + return self.db.get_person_event_types() def _connect_signals(self): self.define_ok_button(self.top.get_widget('ok'),self.ok_clicked) diff --git a/gramps2/src/GrampsDb/_GrampsDbBase.py b/gramps2/src/GrampsDb/_GrampsDbBase.py index 1fc7513c2..01f2c97da 100644 --- a/gramps2/src/GrampsDb/_GrampsDbBase.py +++ b/gramps2/src/GrampsDb/_GrampsDbBase.py @@ -1564,13 +1564,6 @@ class GrampsDbBase(GrampsDBCallback): """ assert False, "Needs to be overridden in the derived class" - def get_person_event_type_list(self): - """ - Returns the list of personal event types contained within the - database. The function must be overridden in the derived class. - """ - return list(self.individual_event_names) - def get_bookmarks(self): """returns the list of Person handles in the bookmarks""" return self.bookmarks diff --git a/gramps2/src/GrampsDb/_GrampsInMemDB.py b/gramps2/src/GrampsDb/_GrampsInMemDB.py index 7b1530401..806946c37 100644 --- a/gramps2/src/GrampsDb/_GrampsInMemDB.py +++ b/gramps2/src/GrampsDb/_GrampsInMemDB.py @@ -151,25 +151,6 @@ class GrampsInMemDB(GrampsDbBase): vals.sort() return vals - def get_person_event_type_list(self): - names = self.eventnames.keys() - a = {} - for name in names: - a[unicode(name)] = 1 - vals = a.keys() - vals.sort() - return vals - - def get_repository_type_list(self): - repos_types = self.repository_types.keys() - a = {} - for repos_type in repos_types: - a[unicode(repos_type)] = 1 - vals = a.keys() - vals.sort() - return vals - - def _del_person(self,handle): person = self.get_person_from_handle(str(handle)) del self.id_trans[person.get_gramps_id()]