minor report improvements

svn: r6259
This commit is contained in:
Brian Matherly 2006-04-04 04:14:51 +00:00
parent 12860c5d4c
commit 7ce865cf79
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> 2006-04-02 Don Allingham <don@gramps-project.org>
* src/GrampsWidgets.py: Fix place autocompletion * src/GrampsWidgets.py: Fix place autocompletion
* src/glade/gramps.glade: start of LDS Ord editor * 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): def fmt_scale_data(self, x, y, cnv):
fd, dest = tempfile.mkstemp() 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) self.img.save(dest,cnv)
fh = open(dest) fh = open(dest)
data = fh.read() data = fh.read()

View File

@ -86,6 +86,7 @@ class DescendantReport(Report.Report):
self.by_birthdate = sort.by_birthdate self.by_birthdate = sort.by_birthdate
def dump_dates(self, person): def dump_dates(self, person):
birth_date = ""
birth_ref = person.get_birth_ref() birth_ref = person.get_birth_ref()
if birth_ref: if birth_ref:
birth = self.database.get_event_from_handle(birth_ref.ref) birth = self.database.get_event_from_handle(birth_ref.ref)
@ -93,6 +94,7 @@ class DescendantReport(Report.Report):
else: else:
birth = None birth = None
death_date = ""
death_ref = person.get_death_ref() death_ref = person.get_death_ref()
if death_ref: if death_ref:
death = self.database.get_event_from_handle(death_ref.ref) death = self.database.get_event_from_handle(death_ref.ref)
@ -133,12 +135,12 @@ class DescendantReport(Report.Report):
self.doc.write_text(', ') self.doc.write_text(', ')
if death_place: if death_place:
self.doc.write_text(_("d. %(death_date)s - %(place)s") % { self.doc.write_text(_("d. %(death_date)s - %(place)s") % {
'death_date' : death, 'death_date' : death_date,
'place' : death_place, 'place' : death_place,
}) })
else: else:
self.doc.write_text(_("d. %(death_date)s") % { self.doc.write_text(_("d. %(death_date)s") % {
'death_date' : death 'death_date' : death_date
}) })
self.doc.write_text(')') self.doc.write_text(')')

View File

@ -44,11 +44,12 @@ import gtk
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import RelLib import RelLib
import Utils
import Errors import Errors
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import Report, ReportOptions, ReportUtils, register_report
import BaseDoc import BaseDoc
import const import const
from DateHandler import displayer as _dd import DateHandler
from NameDisplay import displayer as _nd from NameDisplay import displayer as _nd
from QuestionDialog import ErrorDialog from QuestionDialog import ErrorDialog
@ -305,17 +306,20 @@ class DetDescendantReport(Report.Report):
self.doc.end_paragraph() self.doc.end_paragraph()
first = False first = False
self.doc.start_paragraph('DDR-MoreDetails') 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') % { self.doc.write_text(_('%(name_kind)s: %(name)s%(endnotes)s') % {
'name_kind' : const.NameTypesMap.find_value(alt_name.get_type()), 'name_kind' : atype,
'name' : alt_name.get_regular_name(), 'name' : aname,
'endnotes' : self.endnotes(alt_name), 'endnotes' : self.endnotes(alt_name),
}) })
self.doc.end_paragraph() self.doc.end_paragraph()
if self.includeEvents: if self.includeEvents:
for event_handle in person.get_event_list(): for event_ref in person.get_event_ref_list():
event = self.database.get_event_from_handle(event_handle) event = self.database.get_event_from_handle(event_ref.ref)
date = event.get_date() date = DateHandler.get_date(event)
ename = Utils.format_event( event.get_type() )
place_handle = event.get_place_handle() place_handle = event.get_place_handle()
if place_handle: if place_handle:
place = self.database.get_place_from_handle(place_handle).get_title() 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') self.doc.start_paragraph('DDR-MoreDetails')
if date and place: if date and place:
self.doc.write_text(_('%(event_name)s: %(date)s, %(place)s%(endnotes)s. ') % { self.doc.write_text(_('%(event_name)s: %(date)s, %(place)s%(endnotes)s. ') % {
'event_name' : _(event.get_name()), 'event_name' : ename,
'date' : date, 'date' : date,
'endnotes' : self.endnotes(event), 'endnotes' : self.endnotes(event),
'place' : place }) 'place' : place })
elif date: elif date:
self.doc.write_text(_('%(event_name)s: %(date)s%(endnotes)s. ') % { self.doc.write_text(_('%(event_name)s: %(date)s%(endnotes)s. ') % {
'event_name' : _(event.get_name()), 'event_name' : ename,
'endnotes' : self.endnotes(event), 'endnotes' : self.endnotes(event),
'date' : date}) 'date' : date})
elif place: elif place:
self.doc.write_text(_('%(event_name)s: %(place)s%(endnotes)s. ') % { self.doc.write_text(_('%(event_name)s: %(place)s%(endnotes)s. ') % {
'event_name' : _(event.get_name()), 'event_name' : ename,
'endnotes' : self.endnotes(event), 'endnotes' : self.endnotes(event),
'place' : place }) 'place' : place })
else: else:
self.doc.write_text(_('%(event_name)s: ') % { self.doc.write_text(_('%(event_name)s: ') % {
'event_name' : _(event.get_name())}) 'event_name' : ename})
if event.get_description(): if event.get_description():
self.doc.write_text(event.get_description()) self.doc.write_text(event.get_description())
self.doc.end_paragraph() self.doc.end_paragraph()