From d45f5970fb6fda108647bc7419359f18b2b56c97 Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Sat, 11 Jul 2009 20:11:37 +0000 Subject: [PATCH] add missing iterator methods to filter.py, use get_family_handles instead of the iterator in ExportGedcom.py svn: r12790 --- src/gen/proxy/filter.py | 27 ++++++++++++++++++++++++--- src/plugins/export/ExportGedcom.py | 2 +- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/gen/proxy/filter.py b/src/gen/proxy/filter.py index 30b423c07..9062a1af4 100644 --- a/src/gen/proxy/filter.py +++ b/src/gen/proxy/filter.py @@ -53,19 +53,19 @@ class FilterProxyDb(ProxyDbBase): self.plist = set(person_filter.apply( self.db, self.db.iter_person_handles())) else: - self.plist = self.db.iter_person_handles() + self.plist = self.db.get_person_handles() if event_filter: self.elist = set(event_filter.apply( self.db, self.db.iter_event_handles())) else: - self.elist = self.db.iter_event_handles() + self.elist = self.db.get_event_handles() if note_filter: self.nlist = set(note_filter.apply( self.db, self.db.iter_note_handles())) else: - self.nlist = self.db.iter_note_handles() + self.nlist = self.db.get_note_handles() self.flist = set() for handle in list(self.plist): @@ -295,6 +295,13 @@ class FilterProxyDb(ProxyDbBase): the database. """ return list(self.elist) + + def iter_event_handles(self): + """ + Return an iterator over database handles, one handle for each Person in + the database. + """ + return self.elist def get_family_handles(self): """ @@ -302,6 +309,13 @@ class FilterProxyDb(ProxyDbBase): the database. """ return list(self.flist) + + def iter_family_handles(self): + """ + Return an iterator over database handles, one handle for each Person in + the database. + """ + return self.flist def get_note_handles(self): """ @@ -310,6 +324,13 @@ class FilterProxyDb(ProxyDbBase): """ return list(self.nlist) + def iter_note_handles(self): + """ + Return an iterator over database handles, one handle for each Person in + the database. + """ + return self.nlist + def get_default_person(self): """returns the default Person of the database""" person = self.db.get_default_person() diff --git a/src/plugins/export/ExportGedcom.py b/src/plugins/export/ExportGedcom.py index 1a0b1e3ff..1fccf181f 100644 --- a/src/plugins/export/ExportGedcom.py +++ b/src/plugins/export/ExportGedcom.py @@ -918,7 +918,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): # generate a list of (GRAMPS_ID, HANDLE) pairs. This list # can then be sorted by the sort routine, which will use the # first value of the tuple as the sort key. - sorted_list = sort_handles_by_id(self.dbase.iter_family_handles(), + sorted_list = sort_handles_by_id(self.dbase.get_family_handles(), self.dbase.get_family_from_handle) # loop through the sorted list, pulling of the handle. This list