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> 2008-01-29 Peter Landgren <peter.talken@telia.com>
* src/plugins/ChangeNames.py: Improved capitalization rules for names with * src/plugins/ChangeNames.py: Improved capitalization rules for names with
one prefix and multiple surnames with or without hyphen(s) one prefix and multiple surnames with or without hyphen(s)

View File

@ -41,6 +41,7 @@ import locale
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gen.lib import Date from gen.lib import Date
from BasicUtils import name_displayer as _nd 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) first = self.database.get_person_from_handle(first_id)
second = self.database.get_person_from_handle(second_id) second = self.database.get_person_from_handle(second_id)
birth_ref1 = first.get_birth_ref() birth1 = ReportUtils.get_birth_or_fallback(self.database, first)
if birth_ref1: if birth1:
date1 = self.database.get_event_from_handle(birth_ref1.ref).get_date_object() date1 = birth1.get_date_object()
else: else:
date1 = Date() date1 = Date()
birth_ref2 = second.get_birth_ref() birth2 = ReportUtils.get_birth_or_fallback(self.database, second)
if birth_ref2: if birth2:
date2 = self.database.get_event_from_handle(birth_ref2.ref).get_date_object() date2 = birth2.get_date_object()
else: else:
date2 = Date() date2 = Date()

View File

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