From 7ce865cf79e1527cc248d910350204a819141655 Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Tue, 4 Apr 2006 04:14:51 +0000 Subject: [PATCH] minor report improvements svn: r6259 --- gramps2/ChangeLog | 5 +++++ gramps2/src/ImgManip.py | 2 +- gramps2/src/plugins/DescendReport.py | 6 ++++-- gramps2/src/plugins/DetDescendantReport.py | 24 +++++++++++++--------- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index bca9785c0..688c80e15 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2006-04-03 Brian Matherly + * src/_ImgManip.py: fix typo + * src/plugins/DetDescendantReport.py: remove use of deprecated functions + * src/plugins/DescendReport.py: fix death dates + 2006-04-02 Don Allingham * src/GrampsWidgets.py: Fix place autocompletion * src/glade/gramps.glade: start of LDS Ord editor diff --git a/gramps2/src/ImgManip.py b/gramps2/src/ImgManip.py index b574983ea..0534955b8 100644 --- a/gramps2/src/ImgManip.py +++ b/gramps2/src/ImgManip.py @@ -84,7 +84,7 @@ class ImgManip: def fmt_scale_data(self, x, y, cnv): fd, dest = tempfile.mkstemp() - scaled = self.img.scale_simple(width, height, gtk.gdk.INTERP_BILINEAR) + scaled = self.img.scale_simple(x, y, gtk.gdk.INTERP_BILINEAR) self.img.save(dest,cnv) fh = open(dest) data = fh.read() diff --git a/gramps2/src/plugins/DescendReport.py b/gramps2/src/plugins/DescendReport.py index 420c84892..d92f83ca7 100644 --- a/gramps2/src/plugins/DescendReport.py +++ b/gramps2/src/plugins/DescendReport.py @@ -86,6 +86,7 @@ class DescendantReport(Report.Report): self.by_birthdate = sort.by_birthdate def dump_dates(self, person): + birth_date = "" birth_ref = person.get_birth_ref() if birth_ref: birth = self.database.get_event_from_handle(birth_ref.ref) @@ -93,6 +94,7 @@ class DescendantReport(Report.Report): else: birth = None + death_date = "" death_ref = person.get_death_ref() if death_ref: death = self.database.get_event_from_handle(death_ref.ref) @@ -133,12 +135,12 @@ class DescendantReport(Report.Report): self.doc.write_text(', ') if death_place: self.doc.write_text(_("d. %(death_date)s - %(place)s") % { - 'death_date' : death, + 'death_date' : death_date, 'place' : death_place, }) else: self.doc.write_text(_("d. %(death_date)s") % { - 'death_date' : death + 'death_date' : death_date }) self.doc.write_text(')') diff --git a/gramps2/src/plugins/DetDescendantReport.py b/gramps2/src/plugins/DetDescendantReport.py index 96886ce65..ff24369af 100644 --- a/gramps2/src/plugins/DetDescendantReport.py +++ b/gramps2/src/plugins/DetDescendantReport.py @@ -44,11 +44,12 @@ import gtk # #------------------------------------------------------------------------ import RelLib +import Utils import Errors from PluginUtils import Report, ReportOptions, ReportUtils, register_report import BaseDoc import const -from DateHandler import displayer as _dd +import DateHandler from NameDisplay import displayer as _nd from QuestionDialog import ErrorDialog @@ -305,17 +306,20 @@ class DetDescendantReport(Report.Report): self.doc.end_paragraph() first = False self.doc.start_paragraph('DDR-MoreDetails') + atype = Utils.format_name_type( alt_name.get_type() ) + aname = alt_name.get_regular_name() self.doc.write_text(_('%(name_kind)s: %(name)s%(endnotes)s') % { - 'name_kind' : const.NameTypesMap.find_value(alt_name.get_type()), - 'name' : alt_name.get_regular_name(), + 'name_kind' : atype, + 'name' : aname, 'endnotes' : self.endnotes(alt_name), }) self.doc.end_paragraph() if self.includeEvents: - for event_handle in person.get_event_list(): - event = self.database.get_event_from_handle(event_handle) - date = event.get_date() + for event_ref in person.get_event_ref_list(): + event = self.database.get_event_from_handle(event_ref.ref) + date = DateHandler.get_date(event) + ename = Utils.format_event( event.get_type() ) place_handle = event.get_place_handle() if place_handle: place = self.database.get_place_from_handle(place_handle).get_title() @@ -333,23 +337,23 @@ class DetDescendantReport(Report.Report): self.doc.start_paragraph('DDR-MoreDetails') if date and place: self.doc.write_text(_('%(event_name)s: %(date)s, %(place)s%(endnotes)s. ') % { - 'event_name' : _(event.get_name()), + 'event_name' : ename, 'date' : date, 'endnotes' : self.endnotes(event), 'place' : place }) elif date: self.doc.write_text(_('%(event_name)s: %(date)s%(endnotes)s. ') % { - 'event_name' : _(event.get_name()), + 'event_name' : ename, 'endnotes' : self.endnotes(event), 'date' : date}) elif place: self.doc.write_text(_('%(event_name)s: %(place)s%(endnotes)s. ') % { - 'event_name' : _(event.get_name()), + 'event_name' : ename, 'endnotes' : self.endnotes(event), 'place' : place }) else: self.doc.write_text(_('%(event_name)s: ') % { - 'event_name' : _(event.get_name())}) + 'event_name' : ename}) if event.get_description(): self.doc.write_text(event.get_description()) self.doc.end_paragraph()