diff --git a/ChangeLog b/ChangeLog index 54c03d8ce..925fc7400 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-01-25 Don Allingham + * src/ReportUtils.py: allow start and stop event handle selection + for age estimation + 2005-01-25 Alex Roitman * src/TipOfDay.py (TipOfDay.__init__): Set transent property. * src/gramps_main.py (Gramnps.__init__): Pass itself to TipOfDay; diff --git a/src/ReportUtils.py b/src/ReportUtils.py index 70eaa6d58..ee09d84ff 100644 --- a/src/ReportUtils.py +++ b/src/ReportUtils.py @@ -162,7 +162,7 @@ def draw_vertical_bar_graph(doc, format, start_x, start_y, height, width, data): doc.draw_bar(data[index][0],start,bottom-size,start+box_width,bottom) start += box_width * 1.5 -def estimate_age(db, person): +def estimate_age(db, person, end_handle=None, start_handle=None): """ Estimates the age of a person based off the birth and death dates of the person. A tuple containing the estimated upper @@ -173,12 +173,27 @@ def estimate_age(db, person): @type db: GrampsDbBase @param person: Person object to calculate the age of @type person: Person + @param end_handle: Determines the event handle that determines + the upper limit of the age. If None, the death event is used + @type end_handle: str + @param start_handle: Determines the event handle that determines + the lower limit of the event. If None, the birth event is + used + @type start_handle: str @returns: tuple containing the lower and upper bounds of the person's age, or (-1,-1) if it could not be determined. @rtype: tuple """ - bhandle = person.get_birth_handle() - dhandle = person.get_death_handle() + + if start_handle: + bhandle = start_handle + else: + bhandle = person.get_birth_handle() + + if end_handle: + dhandle = end_handle + else: + dhandle = person.get_death_handle() # if either of the events is not defined, return an error message if not bhandle or not dhandle: diff --git a/src/gramps.glade b/src/gramps.glade index f80422788..6813e9ad5 100644 --- a/src/gramps.glade +++ b/src/gramps.glade @@ -31250,7 +31250,7 @@ Family name Given name GTK_BUTTONBOX_END - + True True True @@ -31321,7 +31321,7 @@ Family name Given name - + True True True @@ -31330,6 +31330,7 @@ Family name Given name GTK_RELIEF_NORMAL True -7 +