* src/Utils.py (probably_alive): If no year is given it now treats people as dead when they have a death event instead of counting them as alive in the curent year when they died in the current year.
svn: r4752
This commit is contained in:
parent
f283347987
commit
85fa8c09ea
@ -1,3 +1,8 @@
|
||||
2005-06-01 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||
* src/Utils.py (probably_alive): If no year is given it now treats
|
||||
people as dead when they have a death event instead of counting them
|
||||
as alive in the curent year when they died in the current year.
|
||||
|
||||
2005-06-01 Anton Huber <anton_huber@gmx.de>
|
||||
* src/po/de.po: Updated translation
|
||||
|
||||
|
@ -447,14 +447,13 @@ def probably_alive(person,db,current_year=None):
|
||||
|
||||
"""
|
||||
|
||||
if not current_year:
|
||||
time_struct = time.localtime(time.time())
|
||||
current_year = time_struct[0]
|
||||
|
||||
death_year = None
|
||||
# If the recorded death year is before current year then
|
||||
# things are simple.
|
||||
if person.death_handle:
|
||||
if not current_year:
|
||||
# no current year and we have a death event -> person died
|
||||
return False
|
||||
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()
|
||||
@ -466,12 +465,19 @@ def probably_alive(person,db,current_year=None):
|
||||
for ev_handle in person.event_list:
|
||||
ev = db.get_event_from_handle(ev_handle)
|
||||
if ev and ev.name in ["Cause Of Death", "Burial", "Cremation"]:
|
||||
if not current_year:
|
||||
# no current year and we have an event related to death
|
||||
return False
|
||||
if not death_year:
|
||||
death_year = ev.get_date_object().get_year()
|
||||
if ev.get_date_object().get_start_date() != Date.EMPTY:
|
||||
if ev.get_date_object().get_year() < current_year:
|
||||
return False
|
||||
|
||||
if not current_year:
|
||||
time_struct = time.localtime(time.time())
|
||||
current_year = time_struct[0]
|
||||
|
||||
birth_year = None
|
||||
# If they were born within 100 years before current year then
|
||||
# assume they are alive (we already know they are not dead).
|
||||
|
Loading…
Reference in New Issue
Block a user