* src/Utils.py: use intermediate variable

svn: r4980
This commit is contained in:
Don Allingham 2005-07-30 03:29:34 +00:00
parent b26b982274
commit d45b36537e
3 changed files with 9 additions and 12 deletions

View File

@ -1,4 +1,5 @@
2005-07-29 Don Allingham <don@gramps-project.org>
* src/Utils.py: use intermediate variable
* src/MergePeople.py: Fix wording of the message.
* src/Report.py: Don't force expansion of widgets
* src/ReportUtils.py: allow restriction of information

View File

@ -469,7 +469,7 @@ def probably_alive(person,db,current_year=None):
death = db.get_event_from_handle(person.death_handle)
if death.get_date_object().get_start_date() != Date.EMPTY:
death_year = death.get_date_object().get_year()
if death.get_date_object().get_year() < current_year:
if death_year < current_year:
return False
# Look for Cause Of Death, Burial or Cremation events.

View File

@ -185,6 +185,7 @@ class BasePage:
def lnkfmt(self,text):
return md5.new(text).hexdigest()
def display_footer(self,of,db):
of.write('</div>\n')
@ -1704,11 +1705,13 @@ class WebReport(Report.Report):
new_list.append(key)
ind_list = new_list
years = time.localtime(time.time())[0] - self.restrict_years
if self.restrict:
new_list = []
for key in ind_list:
if not Utils.probably_alive(self.database.get_person_from_handle(key),
self.database):
p = self.database.get_person_from_handle(key)
if not Utils.probably_alive(p,self.database,years):
new_list.append(key)
ind_list = new_list
@ -1758,14 +1761,6 @@ class WebReport(Report.Report):
if not self.exclude_private:
person = ReportUtils.sanitize_person(self.database,person)
if self.restrict:
years = time.localtime(time.time())[0] - self.restrict_years
else:
years = None
if self.restrict and Utils.probably_alive(person,self.database,years):
person = ReportUtils.restrict_no_names(self.database,person)
idoc = IndividualPage(self.database, person, self.title,
ind_list, place_list, source_list,
self.options, archive, photo_list, levels)
@ -2080,6 +2075,7 @@ class WebReportOptions(ReportOptions.ReportOptions):
user selected choices for later use."""
self.options_dict['NWEBrestrictinfo'] = int(self.restrict_living.get_active())
self.options_dict['NWEBrestrictyears'] = int(self.restrict_years.get_text())
self.options_dict['NWEBincpriv'] = int(not self.no_private.get_active())
self.options_dict['NWEBnoid'] = int(self.noid.get_active())
self.options_dict['NWEBcontact'] = unicode(self.contact.get_handle())
@ -2219,7 +2215,7 @@ class WebReportDialog(Report.ReportDialog):
def parse_format_frame(self):
"""The format frame is not used in this dialog."""
pass
def make_report(self):
"""Create the object that will produce the web pages."""