* src/ReportUtils.py: allow start and stop event handle selection
for age estimation svn: r3967
This commit is contained in:
parent
82e6acd258
commit
23e620f2b5
@ -1,3 +1,7 @@
|
|||||||
|
2005-01-25 Don Allingham <dallingham@users.sourceforge.net>
|
||||||
|
* src/ReportUtils.py: allow start and stop event handle selection
|
||||||
|
for age estimation
|
||||||
|
|
||||||
2005-01-25 Alex Roitman <shura@alex.neuro.umn.edu>
|
2005-01-25 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
* src/TipOfDay.py (TipOfDay.__init__): Set transent property.
|
* src/TipOfDay.py (TipOfDay.__init__): Set transent property.
|
||||||
* src/gramps_main.py (Gramnps.__init__): Pass itself to TipOfDay;
|
* src/gramps_main.py (Gramnps.__init__): Pass itself to TipOfDay;
|
||||||
|
@ -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)
|
doc.draw_bar(data[index][0],start,bottom-size,start+box_width,bottom)
|
||||||
start += box_width * 1.5
|
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
|
Estimates the age of a person based off the birth and death
|
||||||
dates of the person. A tuple containing the estimated upper
|
dates of the person. A tuple containing the estimated upper
|
||||||
@ -173,11 +173,26 @@ def estimate_age(db, person):
|
|||||||
@type db: GrampsDbBase
|
@type db: GrampsDbBase
|
||||||
@param person: Person object to calculate the age of
|
@param person: Person object to calculate the age of
|
||||||
@type person: Person
|
@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
|
@returns: tuple containing the lower and upper bounds of the
|
||||||
person's age, or (-1,-1) if it could not be determined.
|
person's age, or (-1,-1) if it could not be determined.
|
||||||
@rtype: tuple
|
@rtype: tuple
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if start_handle:
|
||||||
|
bhandle = start_handle
|
||||||
|
else:
|
||||||
bhandle = person.get_birth_handle()
|
bhandle = person.get_birth_handle()
|
||||||
|
|
||||||
|
if end_handle:
|
||||||
|
dhandle = end_handle
|
||||||
|
else:
|
||||||
dhandle = person.get_death_handle()
|
dhandle = person.get_death_handle()
|
||||||
|
|
||||||
# if either of the events is not defined, return an error message
|
# if either of the events is not defined, return an error message
|
||||||
|
@ -31250,7 +31250,7 @@ Family name Given name
|
|||||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkButton" id="button1">
|
<widget class="GtkButton" id="next">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_default">True</property>
|
<property name="can_default">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
@ -31321,7 +31321,7 @@ Family name Given name
|
|||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkButton" id="button2">
|
<widget class="GtkButton" id="close">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_default">True</property>
|
<property name="can_default">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
@ -31330,6 +31330,7 @@ Family name Given name
|
|||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="focus_on_click">True</property>
|
||||||
<property name="response_id">-7</property>
|
<property name="response_id">-7</property>
|
||||||
|
<signal name="clicked" handler="gtk_widget_destroy" last_modification_time="Wed, 26 Jan 2005 02:18:57 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
Loading…
Reference in New Issue
Block a user