From f8c349fc7871bc6bd3634ea6049d41b1d7ae96e4 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 20 Feb 2005 23:27:55 +0000 Subject: [PATCH] * src/ReportUtils.py: use today for age calculation if not death date exists. * src/plugins/NavWebPage.py: handle privacy if requested svn: r4064 --- ChangeLog | 5 + src/ReportUtils.py | 36 ++- src/plugins/NavWebPage.py | 554 +++++++++++++++++++------------------- 3 files changed, 304 insertions(+), 291 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8887905ec..fac3f7a2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-02-20 Don Allingham + * src/ReportUtils.py: use today for age calculation if not + death date exists. + * src/plugins/NavWebPage.py: handle privacy if requested + 2005-02-19 Don Allingham * src/ChooseParents.py: readonly fixes diff --git a/src/ReportUtils.py b/src/ReportUtils.py index 5a1751cb5..4258d8885 100644 --- a/src/ReportUtils.py +++ b/src/ReportUtils.py @@ -27,8 +27,11 @@ # #------------------------------------------------------------------------ import Date +import DateHandler import RelLib from NameDisplay import displayer as _nd +import time +from gettext import gettext as _ #------------------------------------------------------------------------- # @@ -168,6 +171,10 @@ def draw_vertical_bar_graph(doc, format, start_x, start_y, height, width, data): doc.draw_bar(data[index][0],start,bottom-size,start+box_width,bottom) start += box_width * 1.5 + +_t = time.localtime(time.time()) +_TODAY = DateHandler.parser.parse("%04d-%02d-%02d" % (_t[0],_t[1],_t[2])) + def estimate_age(db, person, end_handle=None, start_handle=None): """ Estimates the age of a person based off the birth and death @@ -202,11 +209,14 @@ def estimate_age(db, person, end_handle=None, start_handle=None): dhandle = person.get_death_handle() # if either of the events is not defined, return an error message - if not bhandle or not dhandle: + if not bhandle: return (-1,-1) bdata = db.get_event_from_handle(bhandle).get_date_object() - ddata = db.get_event_from_handle(dhandle).get_date_object() + if dhandle: + ddata = db.get_event_from_handle(dhandle).get_date_object() + else: + ddata = _TODAY # if the date is not valid, return an error message if not bdata.get_valid() or not ddata.get_valid(): @@ -263,21 +273,31 @@ def sanitize_person(db,person): # copy gender new_person.set_gender(person.get_gender()) - + new_person.set_gramps_id(person.get_gramps_id()) + new_person.set_handle(person.get_handle()) + # copy names if not private + name = person.get_primary_name() if name.get_privacy() or person.get_privacy(): name = RelLib.Name() name.set_first_name(_('Private')) name.set_surname(_('Private')) else: - name = person.get_primary_name() new_person.set_nick_name(person.get_nick_name()) + new_person.set_primary_name(name) + # copy Family reference list + for handle in person.get_family_handle_list(): + new_person.add_family_handle(handle) + + # copy Family reference list + for item in person.get_parent_family_handle_list(): + new_person.add_parent_family_handle(item[0],item[1],item[2]) + + if person.get_privacy(): return new_person - new_person.set_primary_name(name) - for name in person.get_alternate_names(): if not name.get_privacy(): new_person.add_alternate_name(name) @@ -322,10 +342,6 @@ def sanitize_person(db,person): for obj in person.get_media_list(): new_person.add_media_reference(RelLib.MediaRef(obj)) - # copy Family reference list - for handle in person.get_family_handle_list(): - new_person.add_family_handle(handle) - # LDS ordinances ordinance = person.get_lds_baptism() if ordinance: diff --git a/src/plugins/NavWebPage.py b/src/plugins/NavWebPage.py index 41968e72b..50b2fe20f 100644 --- a/src/plugins/NavWebPage.py +++ b/src/plugins/NavWebPage.py @@ -131,44 +131,44 @@ class BasePage: def lnkfmt(self,text): return text.replace(' ','%20') - def display_footer(self,ofile): - ofile.write('
\n') - ofile.write('
\n') - ofile.write('
\n') - ofile.write('\n') - ofile.write('\n') - ofile.write('\n') + def display_footer(self,of): + of.write('
\n') + of.write('
\n') + of.write('
\n') + of.write('\n') + of.write('\n') + of.write('\n') - def display_header(self,ofile,title,author=""): - ofile.write('\n') - ofile.write('\n\n') - ofile.write('%s\n' % self.title_str) - ofile.write('\n') - ofile.write('\n') - ofile.write('\n') - ofile.write('\n') - ofile.write('\n') - ofile.write('\n') + def display_header(self,of,title,author=""): + of.write('\n') + of.write('\n\n') + of.write('%s\n' % self.title_str) + of.write('\n') + of.write('\n') + of.write('\n') + of.write('\n') + of.write('\n') + of.write('\n') #------------------------------------------------------------------------ # @@ -181,18 +181,18 @@ class IndividualListPage(BasePage): BasePage.__init__(self,title) page_name = os.path.join(html_dir,"individuals.html") - ofile = open(page_name, "w") - self.display_header(ofile,_('Individuals'), + of = open(page_name, "w") + self.display_header(of,_('Individuals'), db.get_researcher().get_name()) - ofile.write('

%s

\n' % _('Individuals')) - ofile.write('

%s

\n' % _('Index of individuals, sorted by last name.')) - ofile.write('
\n') - ofile.write('\n') - ofile.write('\n' % _('Surname')) - ofile.write('\n' % _('Name')) - ofile.write('\n') + of.write('

%s

\n' % _('Individuals')) + of.write('

%s

\n' % _('Index of individuals, sorted by last name.')) + of.write('
\n') + of.write('
%s%s
\n') + of.write('\n' % _('Surname')) + of.write('\n' % _('Name')) + of.write('\n') self.sort = Sort.Sort(db) person_handle_list.sort(self.sort.by_last_name) @@ -202,22 +202,22 @@ class IndividualListPage(BasePage): person = db.get_person_from_handle(person_handle) n = person.get_primary_name().get_surname() if n != last_surname: - ofile.write('\n') - ofile.write('\n') + of.write('\n') + of.write(' ') + of.write('\n') last_surname = n - ofile.write('
%s%s
 
') + of.write('
 
') if n != last_surname: - ofile.write('%s' % (self.lnkfmt(n),n)) + of.write('%s' % (self.lnkfmt(n),n)) else: - ofile.write(' ') - ofile.write('') - ofile.write(person.get_primary_name().get_first_name()) - ofile.write(' ' % person.gramps_id) - ofile.write("[%s]" % person.gramps_id) - ofile.write('
') + of.write(person.get_primary_name().get_first_name()) + of.write(' ' % person.gramps_id) + of.write("[%s]" % person.gramps_id) + of.write('
\n
\n') - self.display_footer(ofile) - ofile.close() + of.write('\n\n') + self.display_footer(of) + of.close() return #------------------------------------------------------------------------ @@ -230,22 +230,22 @@ class PlaceListPage(BasePage): def __init__(self, db, title, place_handles, html_dir, src_list): BasePage.__init__(self,title) page_name = os.path.join(html_dir,"places.html") - ofile = open(page_name, "w") - self.display_header(ofile,_('Places'), + of = open(page_name, "w") + self.display_header(of,_('Places'), db.get_researcher().get_name()) - ofile.write('

%s

\n' % _('Places')) - ofile.write('

%s

\n' % _('Index of all the places in the ' + of.write('

%s

\n' % _('Places')) + of.write('

%s

\n' % _('Index of all the places in the ' 'project.')) - ofile.write('
\n') - ofile.write('\n') - ofile.write('\n' % _('Letter')) - ofile.write('\n' % _('Place')) - ofile.write('\n') + of.write('
\n') + of.write('
') - ofile.write('%s') - ofile.write('%s
\n') + of.write('\n' % _('Letter')) + of.write('\n' % _('Place')) + of.write('\n') self.sort = Sort.Sort(db) handle_list = list(place_handles) @@ -262,25 +262,25 @@ class PlaceListPage(BasePage): if n[0] != last_letter: last_letter = n[0] - ofile.write('\n') - ofile.write('' % last_letter) - ofile.write('') + of.write('\n') + of.write('' % last_letter) + of.write('') elif n != last_letter: last_surname = n - ofile.write('') - ofile.write('') + of.write('') + of.write('') - ofile.write('
') + of.write('%s') + of.write('%s
 
%s') - ofile.write(n) - ofile.write(' ' % place.gramps_id) - ofile.write('[%s]' % place.gramps_id) - ofile.write('
 
%s') + of.write(n) + of.write(' ' % place.gramps_id) + of.write('[%s]' % place.gramps_id) + of.write('
 ') - ofile.write(n) - ofile.write(' ' % place.gramps_id) - ofile.write('[%s]' % place.gramps_id) - ofile.write('
 ') + of.write(n) + of.write(' ' % place.gramps_id) + of.write('[%s]' % place.gramps_id) + of.write('
\n
\n') - self.display_footer(ofile) - ofile.close() + of.write('\n\n') + self.display_footer(of) + of.close() #------------------------------------------------------------------------ # @@ -293,24 +293,24 @@ class SurnameListPage(BasePage): BasePage.__init__(self,title) page_name = os.path.join(html_dir,"surnames.html") - ofile = open(page_name, "w") - self.display_header(ofile,_('Surnames'), + of = open(page_name, "w") + self.display_header(of,_('Surnames'), db.get_researcher().get_name()) - ofile.write('

%s

\n' % _('Surnames')) - ofile.write('

%s

\n' % _('Index of all the surnames in the ' + of.write('

%s

\n' % _('Surnames')) + of.write('

%s

\n' % _('Index of all the surnames in the ' 'project. The links lead to a list ' 'of individuals in the database with ' 'this same surname.')) - ofile.write('
\n') - ofile.write('\n') - ofile.write('\n' % _('Letter')) - ofile.write('\n' % _('Surname')) - ofile.write('\n') + of.write('
\n') + of.write('
') - ofile.write('%s') - ofile.write('%s
\n') + of.write('\n' % _('Letter')) + of.write('\n' % _('Surname')) + of.write('\n') self.sort = Sort.Sort(db) person_handle_list.sort(self.sort.by_last_name) @@ -326,22 +326,22 @@ class SurnameListPage(BasePage): if n[0] != last_letter: last_letter = n[0] - ofile.write('' % last_letter) - ofile.write('') + of.write('' % last_letter) + of.write('') elif n != last_surname: last_surname = n - ofile.write('') - ofile.write('') + of.write('') + of.write('') - ofile.write('
') + of.write('%s') + of.write('%s
%s') - ofile.write('' % self.lnkfmt(n)) - ofile.write(n) - ofile.write('
%s') + of.write('' % self.lnkfmt(n)) + of.write(n) + of.write('
 ') - ofile.write('' % self.lnkfmt(n)) - ofile.write(n) - ofile.write('
 ') + of.write('' % self.lnkfmt(n)) + of.write(n) + of.write('
\n
\n') - self.display_footer(ofile) - ofile.close() + of.write('\n\n') + self.display_footer(of) + of.close() return #------------------------------------------------------------------------ @@ -355,14 +355,14 @@ class IntroductionPage(BasePage): BasePage.__init__(self,title) page_name = os.path.join(html_dir,"introduction.html") - ofile = open(page_name, "w") - self.display_header(ofile,_('Introduction'), + of = open(page_name, "w") + self.display_header(of,_('Introduction'), db.get_researcher().get_name()) - ofile.write('

%s

\n' % _('Introduction')) + of.write('

%s

\n' % _('Introduction')) - self.display_footer(ofile) - ofile.close() + self.display_footer(of) + of.close() #------------------------------------------------------------------------ # @@ -375,14 +375,14 @@ class HomePage(BasePage): BasePage.__init__(self,title) page_name = os.path.join(html_dir,"index.html") - ofile = open(page_name, "w") - self.display_header(ofile,_('Home'), + of = open(page_name, "w") + self.display_header(of,_('Home'), db.get_researcher().get_name()) - ofile.write('

%s

\n' % _('Home')) + of.write('

%s

\n' % _('Home')) - self.display_footer(ofile) - ofile.close() + self.display_footer(of) + of.close() #------------------------------------------------------------------------ # @@ -395,26 +395,26 @@ class SourcesPage(BasePage): BasePage.__init__(self,title) page_name = os.path.join(html_dir,"sources.html") - ofile = open(page_name, "w") - self.display_header(ofile,_('Sources'), + of = open(page_name, "w") + self.display_header(of,_('Sources'), db.get_researcher().get_name()) handle_list = list(handle_set) - ofile.write('

%s

\n

' % _('Sources')) - ofile.write(_('All sources cited in the project.')) - ofile.write('

\n
\n\n') + of.write('

%s

\n

' % _('Sources')) + of.write(_('All sources cited in the project.')) + of.write('

\n
\n
\n') index = 1 for handle in handle_list: - ofile.write('\n' % index) - ofile.write('\n') + of.write('\n' % index) + of.write('\n') - ofile.write('
%d.') - ofile.write('
%d.') + of.write('
\n
\n') + of.write('\n
\n') - self.display_footer(ofile) - ofile.close() + self.display_footer(of) + of.close() #------------------------------------------------------------------------ # @@ -427,14 +427,14 @@ class DownloadPage(BasePage): BasePage.__init__(self,title) page_name = os.path.join(html_dir,"download.html") - ofile = open(page_name, "w") - self.display_header(ofile,_('Download'), + of = open(page_name, "w") + self.display_header(of,_('Download'), db.get_researcher().get_name()) - ofile.write('

%s

\n' % _('Download')) + of.write('

%s

\n' % _('Download')) - self.display_footer(ofile) - ofile.close() + self.display_footer(of) + of.close() #------------------------------------------------------------------------ # @@ -447,14 +447,14 @@ class ContactPage(BasePage): BasePage.__init__(self,title) page_name = os.path.join(html_dir,"contact.html") - ofile = open(page_name, "w") - self.display_header(ofile,_('Contact'), + of = open(page_name, "w") + self.display_header(of,_('Contact'), db.get_researcher().get_name()) - ofile.write('

%s

\n' % _('Contact')) + of.write('

%s

\n' % _('Contact')) - self.display_footer(ofile) - ofile.close() + self.display_footer(of) + of.close() #------------------------------------------------------------------------ # @@ -481,26 +481,26 @@ class IndividualPage(BasePage): self.sort_name = _nd.sorted(self.person) self.name = _nd.sorted(self.person) - ofile = open(os.path.join(dirpath,"%s.html" % person.gramps_id), "w") - self.display_header(ofile, title, + of = open(os.path.join(dirpath,"%s.html" % person.gramps_id), "w") + self.display_header(of, title, self.db.get_researcher().get_name()) - self.display_ind_general(ofile) - self.display_ind_events(ofile) - self.display_ind_relationships(ofile) - self.display_ind_narrative(ofile) - self.display_ind_sources(ofile) - self.display_ind_pedigree(ofile) - self.display_footer(ofile) - ofile.close() + self.display_ind_general(of) + self.display_ind_events(of) + self.display_ind_relationships(of) + self.display_ind_narrative(of) + self.display_ind_sources(of) + self.display_ind_pedigree(of) + self.display_footer(of) + of.close() - def display_ind_sources(self,ofile): + def display_ind_sources(self,of): sreflist = self.person.get_source_references() if not sreflist: return - ofile.write('

%s

\n' % _('Sources')) - ofile.write('
\n') - ofile.write('\n') + of.write('

%s

\n' % _('Sources')) + of.write('
\n') + of.write('
\n') index = 1 for sref in sreflist: @@ -511,7 +511,7 @@ class IndividualPage(BasePage): title = source.get_title() publisher = source.get_publication_info() date = _dd.display(sref.get_date()) - ofile.write('\n') - ofile.write('
%d. ' % index) + of.write('
%d. ' % index) values = [] if author: values.append(author) @@ -521,11 +521,11 @@ class IndividualPage(BasePage): values.append(publisher) if date: values.append(date) - ofile.write(', '.join(values)) - ofile.write('
\n') + of.write(', '.join(values)) + of.write('\n') + of.write('\n') - def display_ind_pedigree(self,ofile): + def display_ind_pedigree(self,of): parent_handle_list = self.person.get_parent_family_handle_list() if parent_handle_list: @@ -540,36 +540,36 @@ class IndividualPage(BasePage): father = None mother = None - ofile.write('

%s

\n' % _('Pedigree')) - ofile.write('
\n
\n') - ofile.write('\n') - ofile.write('\n\n
\n') + of.write('

%s

\n' % _('Pedigree')) + of.write('
\n
\n') + of.write('\n') + of.write('\n\n
\n') if father or mother: - ofile.write('
\n') + of.write('
\n') if father: - self.pedigree_person(ofile,father) + self.pedigree_person(of,father) if mother: - self.pedigree_person(ofile,mother) - ofile.write('
\n') + self.pedigree_person(of,mother) + of.write('
\n') if family: for child_handle in family.get_child_handle_list(): if child_handle == self.person.handle: - ofile.write('| %s
\n' % self.name) - self.pedigree_family(ofile) + of.write('| %s
\n' % self.name) + self.pedigree_family(of) else: child = self.db.get_person_from_handle(child_handle) - self.pedigree_person(ofile,child) + self.pedigree_person(of,child) else: - ofile.write('| %s
\n' % self.name) - self.pedigree_family(ofile) + of.write('| %s
\n' % self.name) + self.pedigree_family(of) - ofile.write('
\n') + of.write('
\n') if father or mother: - ofile.write('
\n') - ofile.write('
\n') + of.write('\n') + of.write('
\n') - def display_ind_general(self,ofile): + def display_ind_general(self,of): photolist = self.person.get_media_list() if photolist: photo_handle = photolist[0].get_reference_handle() @@ -577,62 +577,62 @@ class IndividualPage(BasePage): newpath = self.person.gramps_id + os.path.splitext(photo.get_path())[1] shutil.copyfile(photo.get_path(),os.path.join(self.dirpath,newpath)) - ofile.write('
\n') - ofile.write('' % newpath) - ofile.write('') - ofile.write('
\n') + of.write('
\n') + of.write('' % newpath) + of.write('') + of.write('
\n') - ofile.write('
\n') - ofile.write('

%s

\n' % self.sort_name) - ofile.write('\n') + of.write('
\n') + of.write('

%s

\n' % self.sort_name) + of.write('
\n') # Gender - ofile.write('\n' % _('Gender')) + of.write('\n' % _('Gender')) gender = self.gender_map[self.person.gender] - ofile.write('\n' % gender) - ofile.write('\n') + of.write('\n' % gender) + of.write('\n') # Birth handle = self.person.get_birth_handle() if handle: event = self.db.get_event_from_handle(handle) - ofile.write('\n' % _('Birth')) - ofile.write('\n' % self.format_event(event)) - ofile.write('\n') + of.write('\n' % _('Birth')) + of.write('\n' % self.format_event(event)) + of.write('\n') # Death handle = self.person.get_death_handle() if handle: event = self.db.get_event_from_handle(handle) - ofile.write('\n' % _('Death')) - ofile.write('\n' % self.format_event(event)) - ofile.write('\n') + of.write('\n' % _('Death')) + of.write('\n' % self.format_event(event)) + of.write('\n') - ofile.write('
%s
%s%s
%s
%s%s
%s%s
%s%s
%s%s
\n') - ofile.write('
\n') + of.write('\n') + of.write('\n') - def display_ind_events(self,ofile): - ofile.write('

%s

\n' % _('Events')) - ofile.write('
\n') - ofile.write('\n') + def display_ind_events(self,of): + of.write('

%s

\n' % _('Events')) + of.write('
\n') + of.write('
\n') for event_id in self.person.get_event_list(): event = self.db.get_event_from_handle(event_id) - ofile.write('\n' % event.get_name()) - ofile.write('\n') - ofile.write('\n') + of.write('\n' % event.get_name()) + of.write('\n') + of.write('\n') - ofile.write('
%s\n') - ofile.write(self.format_event(event)) - ofile.write('
%s\n') + of.write(self.format_event(event)) + of.write('
\n') + of.write('\n') - def display_ind_narrative(self,ofile): - ofile.write('

%s

\n' % _('Narrative')) - ofile.write('
\n') + def display_ind_narrative(self,of): + of.write('

%s

\n' % _('Narrative')) + of.write('
\n') noteobj = self.person.get_note_object() if noteobj: @@ -643,73 +643,73 @@ class IndividualPage(BasePage): text = "
" + "
".join(text.split("\n")) else: text = "

".join(text.split("\n")) - ofile.write('

%s

\n' % text) + of.write('

%s

\n' % text) - def display_parent(self,ofile,handle,title): + def display_parent(self,of,handle,title): use_link = handle in self.ind_list person = self.db.get_person_from_handle(handle) - ofile.write('%s\n' % title) - ofile.write('') - ofile.write(_nd.display(person)) + of.write('%s\n' % title) + of.write('') + of.write(_nd.display(person)) if use_link: val = person.gramps_id - ofile.write(' [%s]' % (val,val)) - ofile.write('\n') + of.write(' [%s]' % (val,val)) + of.write('\n') - def display_ind_relationships(self,ofile): + def display_ind_relationships(self,of): parent_list = self.person.get_parent_family_handle_list() family_list = self.person.get_family_handle_list() if not parent_list and not family_list: return - ofile.write('

%s

\n' % _("Relationships")) - ofile.write('
\n') - ofile.write('\n') + of.write('

%s

\n' % _("Relationships")) + of.write('
\n') + of.write('
\n') if parent_list: for (family_handle,mrel,frel) in parent_list: family = self.db.get_family_from_handle(family_handle) - ofile.write('\n') - ofile.write('\n' % _("Parents")) + of.write('\n') + of.write('\n' % _("Parents")) father_handle = family.get_father_handle() if father_handle: - self.display_parent(ofile,father_handle,_('Father')) - ofile.write('\n') + self.display_parent(of,father_handle,_('Father')) + of.write('\n') mother_handle = family.get_mother_handle() if mother_handle: - self.display_parent(ofile,mother_handle,_('Mother')) - ofile.write('\n') - ofile.write('\n') + self.display_parent(of,mother_handle,_('Mother')) + of.write('\n') + of.write('\n') if family_list: - ofile.write('\n' % _("Spouses")) + of.write('\n' % _("Spouses")) first = True for family_handle in family_list: family = self.db.get_family_from_handle(family_handle) - self.display_spouse(ofile,family,first) + self.display_spouse(of,family,first) first = False childlist = family.get_child_handle_list() if childlist: - ofile.write('\n') - ofile.write('\n' % _("Children")) - ofile.write('\n') + of.write('\n' % _("Children")) + of.write('\n\n') - ofile.write('
 
%s
 
%s
 
 
 
 
%s
%s
 %s\n') + of.write('
 %s\n') for child_handle in childlist: use_link = child_handle in self.ind_list child = self.db.get_person_from_handle(child_handle) if use_link: - ofile.write('' % child.get_gramps_id()) - ofile.write(_nd.display(child)) + of.write('' % child.get_gramps_id()) + of.write(_nd.display(child)) if use_link: - ofile.write('\n') - ofile.write("
\n") - ofile.write('
\n') + of.write('\n') + of.write("
\n") + of.write('\n\n') + of.write('\n') - def display_spouse(self,ofile,family,first=True): + def display_spouse(self,of,family,first=True): gender = self.person.get_gender() reltype = family.get_relationship() @@ -730,52 +730,52 @@ class IndividualPage(BasePage): else: name = _("unknown") if not first: - ofile.write(' \n') - ofile.write(' ') - ofile.write('%s\n' % relstr) - ofile.write('') + of.write(' \n') + of.write(' ') + of.write('%s\n' % relstr) + of.write('') use_link = spouse_id in self.ind_list if use_link: - ofile.write('' % spouse.get_gramps_id()) - ofile.write(name) + of.write('' % spouse.get_gramps_id()) + of.write(name) if use_link: - ofile.write('') + of.write('') - ofile.write('\n\n') + of.write('\n\n') for event_id in family.get_event_list(): event = self.db.get_event_from_handle(event_id) - ofile.write(' \n') - ofile.write('%s\n' % event.get_name()) - ofile.write('\n') - ofile.write(self.format_event(event)) - ofile.write('\n\n') + of.write(' \n') + of.write('%s\n' % event.get_name()) + of.write('\n') + of.write(self.format_event(event)) + of.write('\n\n') - def pedigree_person(self,ofile,person,bullet='|'): + def pedigree_person(self,of,person,bullet='|'): person_link = person.handle in self.ind_list - ofile.write('%s ' % bullet) + of.write('%s ' % bullet) if person_link: - ofile.write('' % person.gramps_id) - ofile.write(_nd.display(person)) + of.write('' % person.gramps_id) + of.write(_nd.display(person)) if person_link: - ofile.write('') - ofile.write('
\n') + of.write('') + of.write('
\n') - def pedigree_family(self,ofile): + def pedigree_family(self,of): for family_handle in self.person.get_family_handle_list(): rel_family = self.db.get_family_from_handle(family_handle) spouse_handle = ReportUtils.find_spouse(self.person,rel_family) if spouse_handle: spouse = self.db.get_person_from_handle(spouse_handle) - self.pedigree_person(ofile,spouse,'•') + self.pedigree_person(of,spouse,'•') childlist = rel_family.get_child_handle_list() if childlist: - ofile.write('
\n') + of.write('
\n') for child_handle in childlist: child = self.db.get_person_from_handle(child_handle) - self.pedigree_person(ofile,child) - ofile.write('
\n') + self.pedigree_person(of,child) + of.write('
\n') def format_event(self,event): descr = event.get_description() @@ -929,6 +929,9 @@ class WebReport(Report.Report): for person_handle in ind_list: person = self.database.get_person_from_handle(person_handle) + if not self.private: + person = ReportUtils.sanitize_person(self.database,person) + idoc = IndividualPage(self.database, person, self.title, dir_name, ind_list, place_list, source_list) self.progress_bar_step() @@ -1218,19 +1221,8 @@ class WebReportDialog(Report.ReportDialog): """Create the object that will produce the web pages.""" try: - MyReport = WebReport(self.database,self.person,self.options_class) - """ - self.target_path, - self.max_gen, self.photos, self.filter, - self.restrict, self.private, self.srccomments, - self.include_link, self.include_mini_tree, - self.selected_style, - self.img_dir_text,self.template_name, - self.use_id,self.id_link,self.use_gendex,self.use_places, - self.html_ext,self.include_alpha_links, - self.separate_alpha,self.n_cols, - self.birth_dates,self.year_only) - """ + MyReport = WebReport(self.database,self.person, + self.options_class) MyReport.write_report() except Errors.FilterError, msg: (m1,m2) = msg.messages()