Added marriage information to the AncestorChart
svn: r1037
This commit is contained in:
parent
fa95185e38
commit
e118bf9a19
@ -37,8 +37,6 @@ import string
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
cnv = string.lower
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# AutoCompBase
|
# AutoCompBase
|
||||||
@ -50,7 +48,11 @@ class AutoCompBase:
|
|||||||
if source:
|
if source:
|
||||||
self.nlist = source.nlist
|
self.nlist = source.nlist
|
||||||
else:
|
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.nlist.sort()
|
||||||
self.nl = "xzsdkdjecsc"
|
self.nl = "xzsdkdjecsc"
|
||||||
self.l = 0
|
self.l = 0
|
||||||
@ -135,7 +137,7 @@ class AutoCombo(AutoCompBase):
|
|||||||
"""
|
"""
|
||||||
# Clear any timer
|
# Clear any timer
|
||||||
timer = entry.get_data("timer");
|
timer = entry.get_data("timer");
|
||||||
if (timer):
|
if timer:
|
||||||
gtk.timeout_remove(timer)
|
gtk.timeout_remove(timer)
|
||||||
|
|
||||||
if self.inb == 1:
|
if self.inb == 1:
|
||||||
|
@ -1349,10 +1349,8 @@ class Event(DataObj):
|
|||||||
"""returns 1 if the specified event is the same as the instance"""
|
"""returns 1 if the specified event is the same as the instance"""
|
||||||
if other == None:
|
if other == None:
|
||||||
return 0
|
return 0
|
||||||
if (self.name != other.name or
|
if (self.name != other.name or self.place != other.place or
|
||||||
self.place != other.place or
|
self.description != other.description or self.cause != other.cause or
|
||||||
self.description != other.description or
|
|
||||||
self.cause != other.cause or
|
|
||||||
self.private != other.private or
|
self.private != other.private or
|
||||||
compare_dates(self.getDateObj(),other.getDateObj()) or
|
compare_dates(self.getDateObj(),other.getDateObj()) or
|
||||||
len(self.getSourceRefList()) != len(other.getSourceRefList())):
|
len(self.getSourceRefList()) != len(other.getSourceRefList())):
|
||||||
|
@ -44,16 +44,11 @@ def pt2cm(pt):
|
|||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
#
|
# AncestorChart
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
class AncestorChart:
|
class AncestorChart:
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#--------------------------------------------------------------------
|
|
||||||
def __init__(self,database,person,output,max,doc,display):
|
def __init__(self,database,person,output,max,doc,display):
|
||||||
self.doc = doc
|
self.doc = doc
|
||||||
self.doc.creator(database.getResearcher().getName())
|
self.doc.creator(database.getResearcher().getName())
|
||||||
@ -67,14 +62,11 @@ class AncestorChart:
|
|||||||
self.lines = 0
|
self.lines = 0
|
||||||
self.display = display
|
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):
|
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:
|
if person == None or index >= 2**self.max_generations:
|
||||||
return
|
return
|
||||||
self.map[index] = person
|
self.map[index] = person
|
||||||
@ -87,6 +79,26 @@ class AncestorChart:
|
|||||||
d = person.getDeath().getDate()
|
d = person.getDeath().getDate()
|
||||||
B = person.getBirth().getPlaceName()
|
B = person.getBirth().getPlaceName()
|
||||||
D = person.getDeath().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()
|
i = "%s" % person.getId()
|
||||||
A = GrampsCfg.attr_name
|
A = GrampsCfg.attr_name
|
||||||
a = ""
|
a = ""
|
||||||
@ -105,6 +117,10 @@ class AncestorChart:
|
|||||||
line = string.replace(line,"$i",i)
|
line = string.replace(line,"$i",i)
|
||||||
line = string.replace(line,"$a",a)
|
line = string.replace(line,"$a",a)
|
||||||
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,"$$",'$')
|
line = string.replace(line,"$$",'$')
|
||||||
self.text[index].append(line)
|
self.text[index].append(line)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user