2008-01-29 Gary Burton <gary.burton@zen.co.uk>

* src/plugins/TimeLine.py:
	* src/Sort.py: Use fallback events e.g. baptism/burial when no birth or
	death events are available.



svn: r9956
This commit is contained in:
Gary Burton 2008-01-29 16:40:33 +00:00
parent f5585512fe
commit 7998da0bc0
3 changed files with 20 additions and 18 deletions

View File

@ -1,3 +1,8 @@
2008-01-29 Gary Burton <gary.burton@zen.co.uk>
* src/plugins/TimeLine.py:
* src/Sort.py: Use fallback events e.g. baptism/burial when no birth or
death events are available.
2008-01-29 Peter Landgren <peter.talken@telia.com>
* src/plugins/ChangeNames.py: Improved capitalization rules for names with
one prefix and multiple surnames with or without hyphen(s)

View File

@ -41,6 +41,7 @@ import locale
#-------------------------------------------------------------------------
from gen.lib import Date
from BasicUtils import name_displayer as _nd
from ReportBase import ReportUtils
#-------------------------------------------------------------------------
#
@ -94,15 +95,15 @@ class Sort:
first = self.database.get_person_from_handle(first_id)
second = self.database.get_person_from_handle(second_id)
birth_ref1 = first.get_birth_ref()
if birth_ref1:
date1 = self.database.get_event_from_handle(birth_ref1.ref).get_date_object()
birth1 = ReportUtils.get_birth_or_fallback(self.database, first)
if birth1:
date1 = birth1.get_date_object()
else:
date1 = Date()
birth_ref2 = second.get_birth_ref()
if birth_ref2:
date2 = self.database.get_event_from_handle(birth_ref2.ref).get_date_object()
birth2 = ReportUtils.get_birth_or_fallback(self.database, second)
if birth2:
date2 = birth2.get_date_object()
else:
date2 = Date()

View File

@ -132,16 +132,14 @@ class TimeLine(Report):
for p_id in self.plist:
p = self.database.get_person_from_handle(p_id)
b_ref = p.get_birth_ref()
if b_ref:
birth = self.database.get_event_from_handle(b_ref.ref)
birth = ReportUtils.get_birth_or_fallback(self.database, p)
if birth:
b = birth.get_date_object().get_year()
else:
b = None
d_ref = p.get_death_ref()
if d_ref:
death = self.database.get_event_from_handle(d_ref.ref)
death = ReportUtils.get_death_or_fallback(self.database, p)
if death:
d = death.get_date_object().get_year()
else:
d = None
@ -232,16 +230,14 @@ class TimeLine(Report):
for p_id in self.plist:
p = self.database.get_person_from_handle(p_id)
b_ref = p.get_birth_ref()
if b_ref:
birth = self.database.get_event_from_handle(b_ref.ref)
birth = ReportUtils.get_birth_or_fallback(self.database, p)
if birth:
b = birth.get_date_object().get_year()
else:
b = None
d_ref = p.get_death_ref()
if d_ref:
death = self.database.get_event_from_handle(d_ref.ref)
death = ReportUtils.get_death_or_fallback(self.database, p)
if death:
d = death.get_date_object().get_year()
else:
d = None