Added marriage information to the AncestorChart

svn: r1037
This commit is contained in:
Don Allingham 2002-06-18 04:20:48 +00:00
parent 6267a70ccd
commit c6006484aa
3 changed files with 37 additions and 21 deletions

View File

@ -37,8 +37,6 @@ import string
#-------------------------------------------------------------------------
import gtk
cnv = string.lower
#-------------------------------------------------------------------------
#
# AutoCompBase
@ -50,7 +48,11 @@ class AutoCompBase:
if source:
self.nlist = source.nlist
else:
self.nlist = map((lambda n: (cnv(n),n)),plist)
cnv = string.lower
self.nlist = []
for n in plist:
self.nlist.append((cnv(n),n))
# self.nlist = map((lambda n: (cnv(n),n)),plist)
self.nlist.sort()
self.nl = "xzsdkdjecsc"
self.l = 0
@ -135,7 +137,7 @@ class AutoCombo(AutoCompBase):
"""
# Clear any timer
timer = entry.get_data("timer");
if (timer):
if timer:
gtk.timeout_remove(timer)
if self.inb == 1:

View File

@ -1349,10 +1349,8 @@ class Event(DataObj):
"""returns 1 if the specified event is the same as the instance"""
if other == None:
return 0
if (self.name != other.name or
self.place != other.place or
self.description != other.description or
self.cause != other.cause or
if (self.name != other.name or self.place != other.place or
self.description != other.description or self.cause != other.cause or
self.private != other.private or
compare_dates(self.getDateObj(),other.getDateObj()) or
len(self.getSourceRefList()) != len(other.getSourceRefList())):

View File

@ -44,16 +44,11 @@ def pt2cm(pt):
#------------------------------------------------------------------------
#
#
# AncestorChart
#
#------------------------------------------------------------------------
class AncestorChart:
#--------------------------------------------------------------------
#
#
#
#--------------------------------------------------------------------
def __init__(self,database,person,output,max,doc,display):
self.doc = doc
self.doc.creator(database.getResearcher().getName())
@ -67,14 +62,11 @@ class AncestorChart:
self.lines = 0
self.display = display
#--------------------------------------------------------------------
#
# filter - traverse the ancestors recursively until either the end
# of a line is found, or until we reach the maximum number of
# generations that we want to deal with
#
#--------------------------------------------------------------------
def filter(self,person,index):
"""traverse the ancestors recursively until either the end
of a line is found, or until we reach the maximum number of
generations that we want to deal with"""
if person == None or index >= 2**self.max_generations:
return
self.map[index] = person
@ -87,6 +79,26 @@ class AncestorChart:
d = person.getDeath().getDate()
B = person.getBirth().getPlaceName()
D = person.getDeath().getPlaceName()
if len(person.getFamilyList()) > 0:
f = person.getFamilyList()[0]
if f.getFather() == person:
s = f.getMother().getPrimaryName().getRegularName()
S = f.getMother().getPrimaryName().getName()
else:
s = ""
S = ""
m = ''
M = ''
for e in f.getEventList():
if e.getName == 'Marriage':
m = e.getDate()
M = e.getPlace()
else:
s = ""
S = ""
m = ""
M = ""
i = "%s" % person.getId()
A = GrampsCfg.attr_name
a = ""
@ -105,6 +117,10 @@ class AncestorChart:
line = string.replace(line,"$i",i)
line = string.replace(line,"$a",a)
line = string.replace(line,"$A",A)
line = string.replace(line,"$S",S)
line = string.replace(line,"$s",s)
line = string.replace(line,"$m",m)
line = string.replace(line,"$M",M)
line = string.replace(line,"$$",'$')
self.text[index].append(line)