From 55ff500cfe24ff3918331319e2b25384501a605e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 19 May 2002 00:03:59 +0000 Subject: [PATCH] Fixed several reported bugs svn: r999 --- gramps/src/plugins/DetAncestralReport.py | 25 ++++++++++++++++++++---- gramps/src/plugins/GraphViz.py | 4 ++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gramps/src/plugins/DetAncestralReport.py b/gramps/src/plugins/DetAncestralReport.py index 7a8fd95d0..7bf2d8db9 100644 --- a/gramps/src/plugins/DetAncestralReport.py +++ b/gramps/src/plugins/DetAncestralReport.py @@ -82,11 +82,28 @@ class DetAncestorReport(Report): #print "Children= ", len(family.getChildList()) if num_children > 0: self.doc.start_paragraph("ChildTitle") - mother= family.getMother().getPrimaryName().getRegularName() - father= family.getFather().getPrimaryName().getRegularName() + mom = family.getMother() + dad = family.getFather() + if mom: + mother = mom.getPrimaryName().getRegularName() + if dad: + father = dad.getPrimaryName().getRegularName() + if num_children == 1: - self.doc.write_text(_("Child of %s and %s is:") % (mother, father)) - else: self.doc.write_text(_("Children of %s and %s are:") % (mother, father)) + if mom and dad: + self.doc.write_text(_("Child of %s and %s is:") % (mother, father)) + elif mom: + self.doc.write_text(_("Child of %s is:") % mother) + elif dad: + self.doc.write_text(_("Child of %s is:") % father) + else: + if mom and dad: + self.doc.write_text(_("Children of %s and %s are:") % (mother, father)) + elif mom: + self.doc.write_text(_("Children of %s are:") % mother) + elif dad: + self.doc.write_text(_("Children of %s are:") % father) + self.doc.end_paragraph() for child in family.getChildList(): diff --git a/gramps/src/plugins/GraphViz.py b/gramps/src/plugins/GraphViz.py index 3a8b9afe5..087d4a434 100644 --- a/gramps/src/plugins/GraphViz.py +++ b/gramps/src/plugins/GraphViz.py @@ -287,9 +287,9 @@ def write_dot(file, ind_list, orien, width, height, tb_margin, file.write("center=1;\n") file.write("margin=0.5;\n") file.write("ratio=fill;\n") - file.write("size=\"%3.1f,%3.1f\";\n" % ((width*hpages)-(lr_margin*2)-((hpages-1)*1.0), + file.write("size=\"%3.1fin,%3.1fin\";\n" % ((width*hpages)-(lr_margin*2)-((hpages-1)*1.0), (height*vpages)-(tb_margin*2)-((vpages-1)*1.0))) - file.write("page=\"%3.1f,%3.1f\";\n" % (width,height)) + file.write("page=\"%3.1fin,%3.1fin\";\n" % (width,height)) if orien == PAPER_LANDSCAPE: file.write("rotate=90;\n")