Python 2.1 has a bug with Person being used as an index to a dictionary.

Switched to using the ID instead.


svn: r1128
This commit is contained in:
Don Allingham 2002-08-26 03:17:12 +00:00
parent 907977aa27
commit 8ccfd0438b
4 changed files with 19 additions and 16 deletions

2
gramps/configure vendored
View File

@ -1567,7 +1567,7 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
RELEASE=1
RELEASE=pl1
VERSIONSTRING=$VERSION
if test x"$RELEASE" != "x"

View File

@ -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"

View File

@ -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)

View File

@ -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)