Use new iter_objects methods

svn: r13203
This commit is contained in:
Gerald Britton
2009-09-14 20:50:25 +00:00
parent 5001b771b5
commit 966d2bcd42
20 changed files with 98 additions and 171 deletions

View File

@ -67,10 +67,9 @@ class IsAncestorOfFilterMatch(IsAncestorOf,MatchesFilter):
filt = MatchesFilter(self.list[0:1])
filt.prepare(db)
for person_handle in db.iter_person_handles():
person = db.get_person_from_handle( person_handle)
if filt.apply (db, person):
self.init_ancestor_list (db,person,first)
for person in db.iter_people():
if filt.apply(db, person):
self.init_ancestor_list(db, person, first)
filt.reset()
def reset(self):

View File

@ -53,10 +53,9 @@ class IsChildOfFilterMatch(MatchesFilter):
self.map = {}
filt = MatchesFilter(self.list)
filt.prepare(db)
for person_handle in db.iter_person_handles():
person = db.get_person_from_handle( person_handle)
if filt.apply (db, person):
self.init_list (person)
for person in db.iter_people():
if filt.apply(db, person):
self.init_list(person)
filt.reset()
def reset(self):

View File

@ -67,10 +67,9 @@ class IsDescendantOfFilterMatch(IsDescendantOf,MatchesFilter):
filt = MatchesFilter(self.list[0:1])
filt.prepare(db)
for person_handle in db.iter_person_handles():
person = db.get_person_from_handle( person_handle)
if filt.apply (db, person):
self.init_list (person,first)
for person in db.iter_people():
if filt.apply(db, person):
self.init_list(person, first)
filt.reset()
def reset(self):

View File

@ -53,10 +53,9 @@ class IsParentOfFilterMatch(MatchesFilter):
self.map = {}
filt = MatchesFilter(self.list)
filt.prepare(db)
for person_handle in db.iter_person_handles():
person = db.get_person_from_handle(person_handle)
if filt.apply (db, person):
self.init_list (person)
for person in db.iter_people():
if filt.apply(db, person):
self.init_list(person)
filt.reset()
def reset(self):
@ -68,6 +67,6 @@ class IsParentOfFilterMatch(MatchesFilter):
def init_list(self,person):
for fam_id in person.get_parent_family_handle_list():
fam = self.db.get_family_from_handle(fam_id)
for parent_id in [fam.get_father_handle (), fam.get_mother_handle ()]:
for parent_id in [fam.get_father_handle(), fam.get_mother_handle()]:
if parent_id:
self.map[parent_id] = 1