Simplified the listing of the class FamilyListPage(), so that a couple is only shown once in the list.

svn: r18123
This commit is contained in:
Rob G. Healey 2011-09-08 09:23:10 +00:00
parent 09e9e253fa
commit 1f290c934d

View File

@ -2643,7 +2643,7 @@ class SurnamePage(BasePage):
self.XHTMLWriter(surnamepage, of) self.XHTMLWriter(surnamepage, of)
class FamilyListPage(BasePage): class FamilyListPage(BasePage):
def __init__(self, report, title, ind_list): def __init__(self, report, title, ind_list, displayed):
BasePage.__init__(self, report, title) BasePage.__init__(self, report, title)
db = report.database db = report.database
@ -2704,6 +2704,7 @@ class FamilyListPage(BasePage):
for phandle in handle_list: for phandle in handle_list:
person = db.get_person_from_handle(phandle) person = db.get_person_from_handle(phandle)
if person: if person:
if phandle not in displayed:
fam_hnd_list = person.get_family_handle_list() fam_hnd_list = person.get_family_handle_list()
if fam_hnd_list: if fam_hnd_list:
@ -2751,6 +2752,7 @@ class FamilyListPage(BasePage):
if partner_handle: if partner_handle:
partner = db.get_person_from_handle(partner_handle) partner = db.get_person_from_handle(partner_handle)
if partner: if partner:
displayed.add(partner_handle)
if check_person_database(partner_handle, ind_list): if check_person_database(partner_handle, ind_list):
url = self.report.build_url_fname_html(fhandle, "fam") url = self.report.build_url_fname_html(fhandle, "fam")
tcell += self.family_link(url, self.get_name(partner), tcell += self.family_link(url, self.get_name(partner),
@ -2787,6 +2789,7 @@ class FamilyListPage(BasePage):
tcell1 += ' ' tcell1 += ' '
tcell2 += ' ' tcell2 += ' '
first_family = False first_family = False
displayed.add(phandle)
# add clearline for proper styling # add clearline for proper styling
# add footer section # add footer section
@ -6612,7 +6615,8 @@ class NavWebReport(Report):
# set ProgressMeter for Families/ Relationship pages... # set ProgressMeter for Families/ Relationship pages...
self.progress.set_pass(_("Creating family pages..."), len(db.get_family_handles() )) self.progress.set_pass(_("Creating family pages..."), len(db.get_family_handles() ))
FamilyListPage(self, self.title, ppl_hnd_list) displayed = set()
FamilyListPage(self, self.title, ppl_hnd_list, displayed)
for phandle in ppl_hnd_list: for phandle in ppl_hnd_list:
person = db.get_person_from_handle(phandle) person = db.get_person_from_handle(phandle)