add missing iterator methods to filter.py, use get_family_handles instead of the iterator in ExportGedcom.py

svn: r12790
This commit is contained in:
Gerald Britton 2009-07-11 20:11:37 +00:00
parent aa5fce63a7
commit d45f5970fb
2 changed files with 25 additions and 4 deletions

View File

@ -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()

View File

@ -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