diff --git a/src/AutoComp.py b/src/AutoComp.py index bdebd6c7e..e0b837f43 100644 --- a/src/AutoComp.py +++ b/src/AutoComp.py @@ -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: diff --git a/src/RelLib.py b/src/RelLib.py index 0711620cc..7d7a43ff1 100644 --- a/src/RelLib.py +++ b/src/RelLib.py @@ -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())): diff --git a/src/plugins/AncestorChart.py b/src/plugins/AncestorChart.py index 0d565a000..823eb2c70 100644 --- a/src/plugins/AncestorChart.py +++ b/src/plugins/AncestorChart.py @@ -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)