* src/plugins/GVFamilyLines.py: Use fallback events e.g. baptism/burial

when no birth or death events are available.

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


svn: r9922
This commit is contained in:
Gary Burton 2008-01-23 22:55:51 +00:00
parent a5c3e010cd
commit 4e4e744c48
2 changed files with 35 additions and 21 deletions

View File

@ -1,3 +1,7 @@
2008-01-23 Gary Burton <gary.burton@zen.co.uk>
* src/plugins/GVFamilyLines.py: Use fallback events e.g. baptism/burial
when no birth or death events are available.
2008-01-23 Gary Burton <gary.burton@zen.co.uk> 2008-01-23 Gary Burton <gary.burton@zen.co.uk>
* src/DisplayState.py: Display the Recent Databases menu only if there * src/DisplayState.py: Display the Recent Databases menu only if there
are some recently opened databases. are some recently opened databases.

View File

@ -638,23 +638,32 @@ class FamilyLinesReport(Report):
if surname in self.surnameColours: if surname in self.surnameColours:
colour = self.surnameColours[surname] colour = self.surnameColours[surname]
# see if we have a birth date we can use # see if we have a birth/death or fallback dates we can use
if self.includeDates or self.includePlaces:
bth_event = ReportUtils.get_birth_or_fallback(self.db, person)
dth_event = ReportUtils.get_death_or_fallback(self.db, person)
else:
bth_event = None
dth_event = None
# output the birth or fallback event
birthStr = None birthStr = None
if self.includeDates and person.get_birth_ref(): if bth_event and self.includeDates:
event = self.db.get_event_from_handle(person.get_birth_ref().ref) if (bth_event.private and self.includePrivate) or \
if (event.private and self.includePrivate) or not event.private: not bth_event.private:
date = event.get_date_object() date = bth_event.get_date_object()
if date.get_day_valid() and date.get_month_valid() and date.get_year_valid(): if date.get_day_valid() and date.get_month_valid() and \
date.get_year_valid():
birthStr = _dd.display(date) birthStr = _dd.display(date)
elif date.get_year_valid(): elif date.get_year_valid():
birthStr = '%d' % date.get_year() birthStr = '%d' % date.get_year()
# see if we have a birth place (one of: city, state, or country) we can use # get birth place (one of: city, state, or country) we can use
birthplace = None birthplace = None
if self.includePlaces and person.get_birth_ref(): if bth_event and self.includePlaces:
event = self.db.get_event_from_handle(person.get_birth_ref().ref) if (bth_event.private and self.includePrivate) or \
if (event.private and self.includePrivate) or not event.private: not bth_event.private:
place = self.db.get_place_from_handle(event.get_place_handle()) place = self.db.get_place_from_handle(bth_event.get_place_handle())
if place: if place:
location = place.get_main_location() location = place.get_main_location()
if location.get_city: if location.get_city:
@ -666,21 +675,22 @@ class FamilyLinesReport(Report):
# see if we have a deceased date we can use # see if we have a deceased date we can use
deathStr = None deathStr = None
if self.includeDates and person.get_death_ref(): if dth_event and self.includeDates:
event = self.db.get_event_from_handle(person.get_death_ref().ref) if (dth_event.private and self.includePrivate) or \
if (event.private and self.includePrivate) or not event.private: not dth_event.private:
date = event.get_date_object() date = dth_event.get_date_object()
if date.get_day_valid() and date.get_month_valid() and date.get_year_valid(): if date.get_day_valid() and date.get_month_valid() and \
date.get_year_valid():
deathStr = _dd.display(date) deathStr = _dd.display(date)
elif date.get_year_valid(): elif date.get_year_valid():
deathStr = '%d' % date.get_year() deathStr = '%d' % date.get_year()
# see if we have a place of death (one of: city, state, or country) we can use # get death place (one of: city, state, or country) we can use
deathplace = None deathplace = None
if self.includePlaces and person.get_death_ref(): if dth_event and self.includePlaces:
event = self.db.get_event_from_handle(person.get_death_ref().ref) if (dth_event.private and self.includePrivate) or \
if (event.private and self.includePrivate) or not event.private: not dth_event.private:
place = self.db.get_place_from_handle(event.get_place_handle()) place = self.db.get_place_from_handle(dth_event.get_place_handle())
if place: if place:
location = place.get_main_location() location = place.get_main_location()
if location.get_city: if location.get_city: