From 8ccfd0438b4bd1fd319073a421714a9a4ea74b83 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 26 Aug 2002 03:17:12 +0000 Subject: [PATCH] Python 2.1 has a bug with Person being used as an index to a dictionary. Switched to using the ID instead. svn: r1128 --- gramps/configure | 2 +- gramps/configure.in | 2 +- gramps/src/plugins/DesGraph.py | 14 +++++++------- gramps/src/plugins/WebPage.py | 17 ++++++++++------- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/gramps/configure b/gramps/configure index 0863e5a3d..703603f74 100755 --- a/gramps/configure +++ b/gramps/configure @@ -1567,7 +1567,7 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -RELEASE=1 +RELEASE=pl1 VERSIONSTRING=$VERSION if test x"$RELEASE" != "x" diff --git a/gramps/configure.in b/gramps/configure.in index cabb97945..987d68c6b 100644 --- a/gramps/configure.in +++ b/gramps/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. dnl May need to run automake && aclocal first AC_INIT(src/gramps.py) AM_INIT_AUTOMAKE(gramps, 0.8.0) -RELEASE=1 +RELEASE=pl1 VERSIONSTRING=$VERSION if test x"$RELEASE" != "x" diff --git a/gramps/src/plugins/DesGraph.py b/gramps/src/plugins/DesGraph.py index 4449b0f90..de4c94b92 100644 --- a/gramps/src/plugins/DesGraph.py +++ b/gramps/src/plugins/DesGraph.py @@ -83,20 +83,19 @@ class DescendantReport: self.layout = GraphLayout.DescendLine(plist,person) (self.v,self.e) = self.layout.layout() - self.text = {} for (p,x,y) in self.v: - - self.text[p] = [] + id = p.getId() + self.text[id] = [] subst = SubstKeywords(p) for line in self.display: - self.text[p].append(subst.replace(line)) + self.text[id].append(subst.replace(line)) self.font = self.doc.style_list["Normal"].get_font() - for line in self.text[p]: + for line in self.text[id]: new_width = string_width(self.font,line) self.box_width = max(self.box_width,new_width) - self.lines = max(self.lines,len(self.text[p])) + self.lines = max(self.lines,len(self.text[id])) def write_report(self): @@ -244,7 +243,8 @@ class DescendantReport: if plist: for (p,x,y) in plist: - name = string.join(self.text[p],"\n") + id = p.getId() + name = string.join(self.text[id],"\n") x = (x-1)*delta + left + _sep y = (y-1)*(self.height+_sep)+top self.doc.draw_box("box",name,x,y) diff --git a/gramps/src/plugins/WebPage.py b/gramps/src/plugins/WebPage.py index 34d0ce5aa..a106f5ba4 100644 --- a/gramps/src/plugins/WebPage.py +++ b/gramps/src/plugins/WebPage.py @@ -162,8 +162,9 @@ class IndividualPage: self.doc.start_cell("NormalCell") self.doc.start_paragraph("Data") if person: - if self.list.has_key(person): - self.doc.start_link("%s.%s" % (person.getId(),self.ext)) + id = person.getId() + if self.list.has_key(id): + self.doc.start_link("%s.%s" % (id,self.ext)) self.doc.write_text(person.getPrimaryName().getRegularName()) self.doc.end_link() else: @@ -512,8 +513,9 @@ class IndividualPage: self.doc.start_cell("NormalCell",2) self.doc.start_paragraph("Spouse") if spouse: - if self.list.has_key(spouse): - self.doc.start_link("%s.%s" % (spouse.getId(),self.ext)) + id = spouse.getId() + if self.list.has_key(id): + self.doc.start_link("%s.%s" % (id,self.ext)) self.doc.write_text(spouse.getPrimaryName().getRegularName()) self.doc.end_link() else: @@ -549,8 +551,9 @@ class IndividualPage: first = 0 else: self.doc.write_text('\n') - if self.list.has_key(child): - self.doc.start_link("%s.%s" % (child.getId(),self.ext)) + id = child.getId() + if self.list.has_key(id): + self.doc.start_link("%s.%s" % (id,self.ext)) self.doc.write_text(name) self.doc.end_link() else: @@ -775,7 +778,7 @@ class WebReport(Report): my_map = {} for l in ind_list: - my_map[l] = 1 + my_map[l.getId()] = 1 for person in ind_list: tdoc = HtmlLinkDoc(self.selected_style,None,None,None,doc) tdoc.set_extension(self.ext)