svn: r2217
This commit is contained in:
Alex Roitman 2003-10-08 12:52:31 +00:00
parent 9c1484a001
commit d99bd41d66

View File

@ -107,82 +107,301 @@ class FtmAncestorReport(Report.Report):
self.doc.write_text(name) self.doc.write_text(name)
self.doc.end_bold() self.doc.end_bold()
# add source information here
self.doc.write_text(self.endnotes(pri_name))
# Check birth record # Check birth record
birth = person.getBirth() birth = person.getBirth()
death = person.getDeath() bplace = birth.getPlaceName()
bdate = birth.getDate()
birth_valid = birth.getDate() != "" or birth.getPlaceName() != "" death = person.getDeath()
death_valid = death.getDate() != "" or death.getPlaceName() != "" dplace = death.getPlaceName()
ddate = death.getDate()
birth_valid = bdate != "" or bplace != ""
death_valid = ddate != "" or dplace != ""
if birth_valid or death_valid: if birth_valid or death_valid:
self.doc.write_text(', ') if person.getGender() == RelLib.Person.male:
if bdate:
if bplace:
if ddate:
if dplace:
self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s "
"in %(birth_place)s%(birth_endnotes)s, "
"and died %(death_date)s in %(death_place)s"
"%(death_endnotes)s.") % {
'male_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_date' : bdate, 'birth_place' : bplace,
'death_date' : ddate,'death_place' : dplace,
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
})
else: else:
self.doc.write_text('. ') self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s "
"in %(birth_place)s%(birth_endnotes)s, "
if birth_valid: "and died %(death_date)s%(death_endnotes)s.") % {
date = birth.getDateObj().get_start_date() 'male_name' : '', 'endnotes' : self.endnotes(pri_name),
place = birth.getPlaceName() 'birth_date' : bdate, 'birth_place' : bplace,
if place[-1:] == '.': 'death_date' : ddate,
place = place[:-1] 'birth_endnotes' : self.endnotes(birth),
if date.getDate() != "": 'death_endnotes' : self.endnotes(death),
if place != "": })
t = _("born %(date)s in %(place)s%(endnotes)s") % { else:
'date' : date.getDate(), if dplace:
'place' : place, self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s "
'endnotes' : self.endnotes(birth), "in %(birth_place)s %(birth_endnotes)s, "
} "and died in %(death_place)s%(death_endnotes)s.") % {
else: 'male_name' : '', 'endnotes' : self.endnotes(pri_name),
t = _("born %(date)s%(endnotes)s") % { 'birth_date' : bdate, 'birth_place' : bplace,
'date' : date.getDate(), 'birth_endnotes' : self.endnotes(birth),
'endnotes' : self.endnotes(birth), 'death_endnotes' : self.endnotes(death),
} 'death_place' : dplace,
else: })
if place != "": else:
t = _("born in %(place)s%(endnotes)s") % { self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s in "
'place' : place, "%(birth_place)s%(birth_endnotes)s.") % {
'endnotes' : self.endnotes(birth), 'male_name' : '', 'endnotes' : self.endnotes(pri_name),
} 'birth_date' : bdate, 'birth_place' : bplace,
else: 'birth_endnotes' : self.endnotes(birth),
t = '' })
else:
self.doc.write_text(t) if ddate:
if death_valid: if dplace:
self.doc.write_text('; ') self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, "
else: "and died %(death_date)s in %(death_place)s"
self.doc.write_text('. ') "%(death_endnotes)s.") % {
'male_name' : '', 'endnotes' : self.endnotes(pri_name),
if death_valid: 'birth_date' : bdate, 'death_date' : ddate,
date = death.getDateObj().get_start_date() 'death_place' : dplace,
place = death.getPlaceName() 'birth_endnotes' : self.endnotes(birth),
if place[-1:] == '.': 'death_endnotes' : self.endnotes(death),
place = place[:-1] })
if date.getDate() != "": else:
if place != "": self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, "
t = _("died %(date)s in %(place)s%(endnotes)s.") % { "and died %(death_date)s%(death_endnotes)s.") % {
'date' : date.getDate(), 'male_name' : '', 'endnotes' : self.endnotes(pri_name),
'place' : place, 'birth_date' : bdate, 'death_date' : ddate,
'endnotes' : self.endnotes(death), 'birth_endnotes' : self.endnotes(birth),
} 'death_endnotes' : self.endnotes(death),
else: })
t = _("died %(date)s%(endnotes)s.") % { else:
'date' : date.getDate(), if dplace:
'endnotes' : self.endnotes(death), self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, "
} "and died in %(death_place)s%(death_endnotes)s.") % {
else: 'male_name' : '', 'endnotes' : self.endnotes(pri_name),
if place != "": 'birth_date' : bdate, 'death_place' : dplace,
t = _("died in %(place)s%(endnotes)s.") % { 'birth_endnotes' : self.endnotes(birth),
'place' : place, 'death_endnotes' : self.endnotes(death),
'endnotes' : self.endnotes(death), })
} else:
else: self.doc.write_text(_("%(male_name)s%(endnotes)s was born "
t = '.' "%(birth_date)s%(birth_endnotes)s.") % {
self.doc.write_text(t + ' ') 'male_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_date' : bdate,
'birth_endnotes' : self.endnotes(birth),
})
else:
if bplace:
if ddate:
if dplace:
self.doc.write_text(_("%(male_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, "
"and died %(death_date)s in %(death_place)s"
"%(death_endnotes)s.") % {
'male_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_place' : bplace, 'death_date' : ddate, 'death_place' : dplace,
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
})
else:
self.doc.write_text(_("%(male_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, "
"and died %(death_date)s%(death_endnotes)s.") % {
'male_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
'birth_place' : bplace, 'death_date' : ddate,
})
else:
if dplace:
self.doc.write_text(_("%(male_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, "
"and died in %(death_place)s%(death_endnotes)s.") % {
'male_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_place' : bplace,'death_place' : dplace,
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
})
else:
self.doc.write_text(_("%(male_name)s%(endnotes)s was born "
"in %(birth_place)s%(birth_endnotes)s.") % {
'male_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_place' : bplace,
'birth_endnotes' : self.endnotes(birth),
})
else:
if ddate:
if dplace:
self.doc.write_text(_("%(male_name)s%(endnotes)s died %(death_date)s in "
"%(death_place)s%(death_endnotes)s.") % {
'male_name' : '', 'endnotes' : self.endnotes(pri_name),
'death_date' : ddate, 'death_place' : dplace,
'death_endnotes' : self.endnotes(death),
})
else:
self.doc.write_text(_("%(male_name)s%(endnotes)s "
"died %(death_date)s%(death_endnotes)s.") % {
'male_name' : '', 'endnotes' : self.endnotes(pri_name),
'death_date' : ddate,
'death_endnotes' : self.endnotes(death),
})
else:
if dplace:
self.doc.write_text(_("%(male_name)s%(endnotes)s died "
"in %(death_place)s%(death_endnotes)s.") % {
'male_name' : '', 'endnotes' : self.endnotes(pri_name),
'death_endnotes' : self.endnotes(death),
'death_place' : dplace,
})
else:
if bdate:
if bplace:
if ddate:
if dplace:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s in %(birth_place)s"
"%(birth_endnotes)s, "
"and died %(death_date)s in %(death_place)s"
"%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_date' : bdate, 'birth_place' : bplace,
'death_date' : ddate,'death_place' : dplace,
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
})
else:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s in %(birth_place)s"
"%(birth_endnotes)s, "
"and died %(death_date)s%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_date' : bdate, 'birth_place' : bplace,
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
'death_date' : ddate,
})
else:
if dplace:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s in %(birth_place)s"
"%(birth_endnotes)s, "
"and died in %(death_place)s%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_date' : bdate, 'birth_place' : bplace,
'death_place' : dplace,
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
})
else:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s "
"in %(birth_place)s %(birth_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_endnotes' : self.endnotes(birth),
'birth_date' : bdate, 'birth_place' : bplace,
})
else:
if ddate:
if dplace:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, "
"and died %(death_date)s in %(death_place)s"
"%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_date' : bdate, 'death_date' : ddate,
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
'death_place' : dplace,
})
else:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, "
"and died %(death_date)s%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
'birth_date' : bdate, 'death_date' : ddate,
})
else:
if dplace:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, "
"and died in %(death_place)s%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
'birth_date' : bdate, 'death_place' : dplace,
})
else:
self.doc.write_text(_("%(female_name)s%(endnotes)s was "
"born %(birth_date)s%(birth_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_endnotes' : self.endnotes(birth),
'birth_date' : bdate,
})
else:
if bplace:
if ddate:
if dplace:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, "
"and died %(death_date)s in %(death_place)s%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
'birth_place' : bplace, 'death_date' : ddate, 'death_place' : dplace,
})
else:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, "
"and died %(death_date)s%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
'birth_place' : bplace, 'death_date' : ddate,
})
else:
if dplace:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, "
"and died in %(death_place)s%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_endnotes' : self.endnotes(birth),
'death_endnotes' : self.endnotes(death),
'birth_place' : bplace,'death_place' : dplace,
})
else:
self.doc.write_text(_("%(female_name)s%(endnotes)s was born "
"in %(birth_place)s%(birth_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'birth_endnotes' : self.endnotes(birth),
'birth_place' : bplace,
})
else:
if ddate:
if dplace:
self.doc.write_text(_("%(female_name)s%(endnotes)s died %(death_date)s in "
"%(death_place)s%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'death_endnotes' : self.endnotes(death),
'death_date' : ddate, 'death_place' : dplace,
})
else:
self.doc.write_text(_("%(female_name)s%(endnotes)s "
"died %(death_date)s%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'death_endnotes' : self.endnotes(death),
'death_date' : ddate,
})
else:
if dplace:
self.doc.write_text(_("%(female_name)s%(endnotes)s died "
"in %(death_place)s%(death_endnotes)s.") % {
'female_name' : '', 'endnotes' : self.endnotes(pri_name),
'death_endnotes' : self.endnotes(death),
'birth_date' : bdate, 'death_place' : dplace,
})
else:
self.doc.write_text( "%s." % self.endnotes(pri_name) )
self.doc.write_text(' ')
self.print_parents(person,death_valid) self.print_parents(person,death_valid)
self.print_spouse(person) self.print_spouse(person)
self.doc.end_paragraph() self.doc.end_paragraph()