minor report improvements

svn: r6259
This commit is contained in:
Brian Matherly 2006-04-04 04:14:51 +00:00
parent a30cfaeb12
commit d52f881814
4 changed files with 24 additions and 13 deletions

View File

@ -1,3 +1,8 @@
2006-04-03 Brian Matherly <pez4brian@users.sourceforge.net>
* 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 <don@gramps-project.org>
* src/GrampsWidgets.py: Fix place autocompletion
* src/glade/gramps.glade: start of LDS Ord editor

View File

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

View File

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

View File

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