2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
2005-02-01 10:38:16 +05:30
|
|
|
# Copyright (C) 2000-2002 Bruce J. DeGrasse
|
2007-06-28 11:11:40 +05:30
|
|
|
# Copyright (C) 2000-2007 Donald N. Allingham
|
2008-03-02 04:17:48 +05:30
|
|
|
# Copyright (C) 2007-2008 Brian G. Matherly
|
2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
2003-12-15 09:48:51 +05:30
|
|
|
# $Id$
|
|
|
|
|
2008-03-02 04:17:48 +05:30
|
|
|
"""Reports/Text Reports/Detailed Ancestral Report"""
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2005-01-01 07:47:17 +05:30
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# standard python modules
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2006-04-07 03:32:46 +05:30
|
|
|
from gettext import gettext as _
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2005-01-01 07:47:17 +05:30
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GRAMPS modules
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2007-10-08 22:11:39 +05:30
|
|
|
import gen.lib
|
2008-05-19 00:54:28 +05:30
|
|
|
from PluginUtils import PluginManager, NumberOption, \
|
2008-01-06 02:12:05 +05:30
|
|
|
BooleanOption, PersonOption
|
2007-12-28 10:42:30 +05:30
|
|
|
from ReportBase import Report, ReportUtils, MenuReportOptions, \
|
2006-06-01 10:09:40 +05:30
|
|
|
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
|
2007-06-13 09:43:00 +05:30
|
|
|
from ReportBase import Bibliography, Endnotes
|
2003-09-02 06:17:09 +05:30
|
|
|
import BaseDoc
|
2006-03-30 08:47:33 +05:30
|
|
|
import DateHandler
|
2007-06-28 11:11:40 +05:30
|
|
|
from BasicUtils import name_displayer as _nd
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Constants
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2005-02-01 10:38:16 +05:30
|
|
|
EMPTY_ENTRY = "_____________"
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2006-06-01 10:09:40 +05:30
|
|
|
class DetAncestorReport(Report):
|
2003-02-16 04:33:48 +05:30
|
|
|
|
2008-02-20 10:22:10 +05:30
|
|
|
def __init__(self, database, options_class):
|
2005-01-01 07:47:17 +05:30
|
|
|
"""
|
2008-02-24 19:25:55 +05:30
|
|
|
Create the DetAncestorReport object that produces the report.
|
2005-01-01 07:47:17 +05:30
|
|
|
|
|
|
|
The arguments are:
|
|
|
|
|
|
|
|
database - the GRAMPS database instance
|
|
|
|
person - currently selected person
|
|
|
|
options_class - instance of the Options class for this report
|
|
|
|
|
|
|
|
This report needs the following parameters (class variables)
|
|
|
|
that come in the options class.
|
|
|
|
|
|
|
|
gen - Maximum number of generations to include.
|
|
|
|
pagebgg - Whether to include page breaks between generations.
|
|
|
|
firstName - Whether to use first names instead of pronouns.
|
2008-01-23 11:11:46 +05:30
|
|
|
fulldate - Whether to use full dates instead of just year.
|
|
|
|
listchildren - Whether to list children.
|
|
|
|
includenotes - Whether to include notes.
|
|
|
|
incattrs - Whether to include attributes
|
|
|
|
blankplace - Whether to replace missing Places with ___________.
|
2005-01-01 07:47:17 +05:30
|
|
|
blankDate - Whether to replace missing Dates with ___________.
|
2008-01-23 11:11:46 +05:30
|
|
|
calcageflag - Whether to compute age.
|
|
|
|
dupperson - Whether to omit duplicate ancestors (e.g. when distant cousins mary).
|
2008-01-06 11:43:37 +05:30
|
|
|
verbose - Whether to use complete sentences
|
2008-01-23 11:11:46 +05:30
|
|
|
childref - Whether to add descendant references in child list.
|
|
|
|
addimages - Whether to include images.
|
2008-01-06 02:12:05 +05:30
|
|
|
pid - The Gramps ID of the center person for the report.
|
2005-01-01 07:47:17 +05:30
|
|
|
"""
|
2008-02-20 10:22:10 +05:30
|
|
|
Report.__init__(self, database, options_class)
|
2005-01-01 07:47:17 +05:30
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
self.map = {}
|
2005-01-01 07:47:17 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
menu = options_class.menu
|
|
|
|
self.max_generations = menu.get_option_by_name('gen').get_value()
|
|
|
|
self.pgbrk = menu.get_option_by_name('pagebbg').get_value()
|
|
|
|
self.fulldate = menu.get_option_by_name('fulldates').get_value()
|
|
|
|
self.listchildren = menu.get_option_by_name('listc').get_value()
|
|
|
|
self.includenotes = menu.get_option_by_name('incnotes').get_value()
|
|
|
|
self.usecall = menu.get_option_by_name('usecall').get_value()
|
|
|
|
blankplace = menu.get_option_by_name('repplace').get_value()
|
|
|
|
blankdate = menu.get_option_by_name('repdate').get_value()
|
|
|
|
self.calcageflag = menu.get_option_by_name('computeage').get_value()
|
|
|
|
self.dupperson = menu.get_option_by_name('omitda').get_value()
|
|
|
|
self.verbose = menu.get_option_by_name('verbose').get_value()
|
|
|
|
self.childref = menu.get_option_by_name('desref').get_value()
|
|
|
|
self.addimages = menu.get_option_by_name('incphotos').get_value()
|
|
|
|
self.inc_names = menu.get_option_by_name('incnames').get_value()
|
|
|
|
self.inc_events = menu.get_option_by_name('incevents').get_value()
|
|
|
|
self.inc_addr = menu.get_option_by_name('incaddresses').get_value()
|
|
|
|
self.inc_sources = menu.get_option_by_name('incsources').get_value()
|
|
|
|
self.inc_attrs = menu.get_option_by_name('incattrs').get_value()
|
|
|
|
pid = menu.get_option_by_name('pid').get_value()
|
2008-01-06 02:12:05 +05:30
|
|
|
self.center_person = database.get_person_from_gramps_id(pid)
|
2005-01-01 07:47:17 +05:30
|
|
|
|
2005-02-01 10:38:16 +05:30
|
|
|
self.gen_handles = {}
|
2008-01-23 11:11:46 +05:30
|
|
|
self.prev_gen_handles = {}
|
2005-02-01 10:38:16 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if blankdate:
|
2005-02-01 10:38:16 +05:30
|
|
|
self.EMPTY_DATE = EMPTY_ENTRY
|
|
|
|
else:
|
|
|
|
self.EMPTY_DATE = ""
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if blankplace:
|
2005-02-01 10:38:16 +05:30
|
|
|
self.EMPTY_PLACE = EMPTY_ENTRY
|
|
|
|
else:
|
|
|
|
self.EMPTY_PLACE = ""
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2007-07-23 17:52:03 +05:30
|
|
|
self.bibli = Bibliography(Bibliography.MODE_PAGE)
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2005-01-01 07:47:17 +05:30
|
|
|
def apply_filter(self,person_handle,index):
|
2004-07-28 07:59:07 +05:30
|
|
|
if (not person_handle) or (index >= 2**self.max_generations):
|
2002-10-20 19:55:16 +05:30
|
|
|
return
|
2004-07-28 07:59:07 +05:30
|
|
|
self.map[index] = person_handle
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2004-08-07 10:46:57 +05:30
|
|
|
person = self.database.get_person_from_handle(person_handle)
|
2004-07-28 07:59:07 +05:30
|
|
|
family_handle = person.get_main_parents_family_handle()
|
|
|
|
if family_handle:
|
2004-08-20 03:05:16 +05:30
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
2005-01-01 07:47:17 +05:30
|
|
|
self.apply_filter(family.get_father_handle(),index*2)
|
|
|
|
self.apply_filter(family.get_mother_handle(),(index*2)+1)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2005-02-01 10:38:16 +05:30
|
|
|
def write_report(self):
|
2008-01-06 02:12:05 +05:30
|
|
|
self.apply_filter(self.center_person.get_handle(),1)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2008-01-06 02:12:05 +05:30
|
|
|
name = _nd.display_name(self.center_person.get_primary_name())
|
2005-02-01 10:38:16 +05:30
|
|
|
self.doc.start_paragraph("DAR-Title")
|
2005-12-06 12:08:09 +05:30
|
|
|
title = _("Ancestral Report for %s") % name
|
2006-06-04 09:56:28 +05:30
|
|
|
mark = BaseDoc.IndexMark(title,BaseDoc.INDEX_TYPE_TOC,1)
|
|
|
|
self.doc.write_text(title,mark)
|
2005-02-01 10:38:16 +05:30
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
|
|
|
keys = self.map.keys()
|
|
|
|
keys.sort()
|
|
|
|
generation = 0
|
|
|
|
need_header = 1
|
|
|
|
|
|
|
|
for key in keys :
|
|
|
|
if generation == 0 or key >= 2**generation:
|
|
|
|
if self.pgbrk and generation > 0:
|
|
|
|
self.doc.page_break()
|
|
|
|
self.doc.start_paragraph("DAR-Generation")
|
2005-12-06 12:08:09 +05:30
|
|
|
text = _("Generation %d") % (generation+1)
|
2006-06-04 09:56:28 +05:30
|
|
|
mark = BaseDoc.IndexMark(text,BaseDoc.INDEX_TYPE_TOC,2)
|
|
|
|
self.doc.write_text(text,mark)
|
2005-02-01 10:38:16 +05:30
|
|
|
self.doc.end_paragraph()
|
|
|
|
generation = generation + 1
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.childref:
|
2005-02-02 10:39:07 +05:30
|
|
|
self.prev_gen_handles= self.gen_handles.copy()
|
2005-02-01 10:38:16 +05:30
|
|
|
self.gen_handles.clear()
|
|
|
|
|
|
|
|
person_handle = self.map[key]
|
|
|
|
person = self.database.get_person_from_handle(person_handle)
|
2005-02-02 10:39:07 +05:30
|
|
|
self.gen_handles[person_handle] = key
|
2008-01-23 11:11:46 +05:30
|
|
|
dupperson = self.write_person(key)
|
|
|
|
if dupperson == 0: # Is this a duplicate ind record
|
|
|
|
if self.listchildren or self.inc_events:
|
2005-02-01 10:38:16 +05:30
|
|
|
for family_handle in person.get_family_handle_list():
|
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
2006-08-07 08:23:28 +05:30
|
|
|
mother_handle = family.get_mother_handle()
|
2008-06-16 20:31:46 +05:30
|
|
|
if mother_handle is None or \
|
2007-10-08 22:11:39 +05:30
|
|
|
person.get_gender() == gen.lib.Person.FEMALE:
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.listchildren:
|
2006-11-14 10:09:55 +05:30
|
|
|
self.write_children(family)
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_events:
|
2006-11-14 10:09:55 +05:30
|
|
|
self.write_family_events(family)
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_sources:
|
2007-06-13 09:43:00 +05:30
|
|
|
Endnotes.write_endnotes(self.bibli,self.database,self.doc)
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2005-02-01 10:38:16 +05:30
|
|
|
def write_person(self, key):
|
|
|
|
"""Output birth, death, parentage, marriage and notes information """
|
|
|
|
|
|
|
|
person_handle = self.map[key]
|
|
|
|
person = self.database.get_person_from_handle(person_handle)
|
2005-12-06 12:08:09 +05:30
|
|
|
plist = person.get_media_list()
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.addimages and len(plist) > 0:
|
2005-12-06 12:08:09 +05:30
|
|
|
photo = plist[0]
|
|
|
|
ReportUtils.insert_image(self.database,self.doc,photo)
|
2005-02-01 10:38:16 +05:30
|
|
|
|
|
|
|
self.doc.start_paragraph("DAR-First-Entry","%s." % str(key))
|
|
|
|
|
2005-12-06 12:08:09 +05:30
|
|
|
name = _nd.display_formal(person)
|
2006-06-03 09:02:26 +05:30
|
|
|
mark = ReportUtils.get_person_mark(self.database, person)
|
2005-02-01 10:38:16 +05:30
|
|
|
|
|
|
|
self.doc.start_bold()
|
2006-06-03 09:02:26 +05:30
|
|
|
self.doc.write_text(name,mark)
|
2005-12-06 12:08:09 +05:30
|
|
|
if name[-1:] == '.':
|
2007-06-13 09:43:00 +05:30
|
|
|
self.doc.write_text("%s " % self.endnotes(person))
|
2005-12-06 12:08:09 +05:30
|
|
|
else:
|
2007-06-13 09:43:00 +05:30
|
|
|
self.doc.write_text("%s. " % self.endnotes(person))
|
2005-02-01 10:38:16 +05:30
|
|
|
self.doc.end_bold()
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.dupperson:
|
2005-02-01 10:38:16 +05:30
|
|
|
# Check for duplicate record (result of distant cousins marrying)
|
|
|
|
keys = self.map.keys()
|
|
|
|
keys.sort()
|
|
|
|
for dkey in keys:
|
|
|
|
if dkey >= key:
|
|
|
|
break
|
|
|
|
if self.map[key] == self.map[dkey]:
|
2005-12-06 12:08:09 +05:30
|
|
|
self.doc.write_text(
|
|
|
|
_("%(name)s is the same person as [%(id_str)s].") %
|
|
|
|
{ 'name' : '', 'id_str' : str(dkey) })
|
2005-02-01 10:38:16 +05:30
|
|
|
self.doc.end_paragraph()
|
|
|
|
return 1 # Duplicate person
|
|
|
|
|
|
|
|
# Check birth record
|
2005-12-06 12:08:09 +05:30
|
|
|
|
2006-11-20 18:46:22 +05:30
|
|
|
first = ReportUtils.common_name(person,self.usecall)
|
2008-01-06 11:43:37 +05:30
|
|
|
|
|
|
|
if not self.verbose:
|
|
|
|
self.write_parents(person, first)
|
|
|
|
|
|
|
|
text = ReportUtils.born_str(self.database,person,first,self.verbose,
|
2005-12-06 12:08:09 +05:30
|
|
|
self.EMPTY_DATE,self.EMPTY_PLACE)
|
|
|
|
if text:
|
2006-03-30 08:47:33 +05:30
|
|
|
birth_ref = person.get_birth_ref()
|
|
|
|
if birth_ref:
|
|
|
|
birth = self.database.get_event_from_handle(birth_ref.ref)
|
2007-06-13 09:43:00 +05:30
|
|
|
text = text.rstrip(". ")
|
|
|
|
text = text + self.endnotes(birth) + ". "
|
|
|
|
self.doc.write_text(text)
|
2005-12-06 12:08:09 +05:30
|
|
|
first = 0
|
2005-02-01 10:38:16 +05:30
|
|
|
|
2006-03-01 01:24:35 +05:30
|
|
|
age,units = self.calc_age(person)
|
2008-01-06 11:43:37 +05:30
|
|
|
text = ReportUtils.died_str(self.database,person,first,self.verbose,
|
2006-03-01 01:24:35 +05:30
|
|
|
self.EMPTY_DATE,self.EMPTY_PLACE,age,units)
|
2005-12-06 12:08:09 +05:30
|
|
|
if text:
|
2007-06-19 10:02:06 +05:30
|
|
|
death_ref = person.get_death_ref()
|
2006-03-30 08:47:33 +05:30
|
|
|
if death_ref:
|
|
|
|
death = self.database.get_event_from_handle(death_ref.ref)
|
2007-06-13 09:43:00 +05:30
|
|
|
text = text.rstrip(". ")
|
|
|
|
text = text + self.endnotes(death) + ". "
|
|
|
|
self.doc.write_text(text)
|
2005-12-06 12:08:09 +05:30
|
|
|
first = 0
|
2005-02-01 10:38:16 +05:30
|
|
|
|
2005-12-06 12:08:09 +05:30
|
|
|
text = ReportUtils.buried_str(self.database,person,first,
|
|
|
|
self.EMPTY_DATE,self.EMPTY_PLACE)
|
2005-02-01 10:38:16 +05:30
|
|
|
if text:
|
|
|
|
self.doc.write_text(text)
|
|
|
|
|
2006-11-20 18:46:22 +05:30
|
|
|
first = ReportUtils.common_name(person,self.usecall)
|
2005-12-06 12:08:09 +05:30
|
|
|
|
2008-01-06 11:43:37 +05:30
|
|
|
if self.verbose:
|
|
|
|
self.write_parents(person, first)
|
|
|
|
|
|
|
|
if not key % 2 or key == 1:
|
|
|
|
self.write_marriage(person)
|
2005-02-01 10:38:16 +05:30
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
|
|
|
if key == 1:
|
|
|
|
self.write_mate(person)
|
|
|
|
|
2007-03-27 09:48:14 +05:30
|
|
|
notelist = person.get_note_list()
|
2008-01-23 11:11:46 +05:30
|
|
|
if len(notelist) > 0 and self.includenotes:
|
2005-02-01 10:38:16 +05:30
|
|
|
self.doc.start_paragraph("DAR-NoteHeader")
|
2005-04-26 21:34:21 +05:30
|
|
|
self.doc.write_text(_("Notes for %s") % name)
|
2005-02-01 10:38:16 +05:30
|
|
|
self.doc.end_paragraph()
|
2007-03-27 09:48:14 +05:30
|
|
|
for notehandle in notelist:
|
|
|
|
note = self.database.get_note_from_handle(notehandle)
|
2008-02-24 19:25:55 +05:30
|
|
|
self.doc.write_note(note.get(), note.get_format(),"DAR-Entry")
|
2005-02-01 10:38:16 +05:30
|
|
|
|
2005-12-06 12:08:09 +05:30
|
|
|
first = True
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_names:
|
2005-08-18 11:28:28 +05:30
|
|
|
for alt_name in person.get_alternate_names():
|
|
|
|
if first:
|
|
|
|
self.doc.start_paragraph('DAR-MoreHeader')
|
|
|
|
self.doc.write_text(_('More about %(person_name)s:') % {
|
|
|
|
'person_name' : name })
|
|
|
|
self.doc.end_paragraph()
|
2005-12-06 12:08:09 +05:30
|
|
|
first = False
|
2005-08-18 11:28:28 +05:30
|
|
|
self.doc.start_paragraph('DAR-MoreDetails')
|
2006-04-22 12:26:48 +05:30
|
|
|
atype = str( alt_name.get_type() )
|
2005-12-06 12:08:09 +05:30
|
|
|
self.doc.write_text(
|
|
|
|
_('%(name_kind)s: %(name)s%(endnotes)s') % {
|
2006-04-22 12:26:48 +05:30
|
|
|
'name_kind' : atype,
|
2005-08-18 11:28:28 +05:30
|
|
|
'name' : alt_name.get_regular_name(),
|
|
|
|
'endnotes' : self.endnotes(alt_name),
|
|
|
|
})
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_events:
|
2006-06-28 09:31:14 +05:30
|
|
|
birth_ref = person.get_birth_ref()
|
|
|
|
death_ref = person.get_death_ref()
|
2006-11-22 10:13:33 +05:30
|
|
|
for event_ref in person.get_primary_event_ref_list():
|
2006-06-28 09:31:14 +05:30
|
|
|
if event_ref == birth_ref or event_ref == death_ref:
|
|
|
|
continue
|
2005-08-18 11:28:28 +05:30
|
|
|
|
|
|
|
if first:
|
|
|
|
self.doc.start_paragraph('DAR-MoreHeader')
|
|
|
|
self.doc.write_text(_('More about %(person_name)s:') % {
|
2005-12-06 12:08:09 +05:30
|
|
|
'person_name' : _nd.display(person) })
|
2005-08-18 11:28:28 +05:30
|
|
|
self.doc.end_paragraph()
|
|
|
|
first = 0
|
2006-11-14 10:09:55 +05:30
|
|
|
|
|
|
|
self.write_event(event_ref)
|
2007-01-23 07:21:33 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_addr:
|
2007-01-23 07:21:33 +05:30
|
|
|
for addr in person.get_address_list():
|
|
|
|
if first:
|
|
|
|
self.doc.start_paragraph('DAR-MoreHeader')
|
|
|
|
self.doc.write_text(_('More about %(person_name)s:') % {
|
|
|
|
'person_name' : name })
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
first = False
|
|
|
|
self.doc.start_paragraph('DAR-MoreDetails')
|
|
|
|
|
|
|
|
text = ReportUtils.get_address_str(addr)
|
|
|
|
date = DateHandler.get_date(addr)
|
|
|
|
self.doc.write_text(_('Address: '))
|
|
|
|
if date:
|
|
|
|
self.doc.write_text( '%s, ' % date )
|
|
|
|
self.doc.write_text( text )
|
|
|
|
self.doc.write_text( self.endnotes(addr) )
|
|
|
|
self.doc.end_paragraph()
|
2007-08-12 09:04:28 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_attrs:
|
2007-08-12 09:04:28 +05:30
|
|
|
attrs = person.get_attribute_list()
|
|
|
|
if first and attrs:
|
|
|
|
self.doc.start_paragraph('DAR-MoreHeader')
|
|
|
|
self.doc.write_text(_('More about %(person_name)s:') % {
|
|
|
|
'person_name' : name })
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
first = False
|
|
|
|
|
|
|
|
for attr in attrs:
|
|
|
|
self.doc.start_paragraph('DAR-MoreDetails')
|
|
|
|
text = _("%(type)s: %(value)s%(endnotes)s") % {
|
|
|
|
'type' : attr.get_type(),
|
|
|
|
'value' : attr.get_value(),
|
|
|
|
'endnotes' : self.endnotes(attr) }
|
|
|
|
self.doc.write_text( text )
|
|
|
|
self.doc.end_paragraph()
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2005-02-01 10:38:16 +05:30
|
|
|
return 0 # Not duplicate person
|
2006-11-14 10:09:55 +05:30
|
|
|
|
|
|
|
def write_event(self, event_ref):
|
2007-06-13 09:43:00 +05:30
|
|
|
text = ""
|
2006-11-14 10:09:55 +05:30
|
|
|
event = self.database.get_event_from_handle(event_ref.ref)
|
|
|
|
date = DateHandler.get_date(event)
|
|
|
|
ph = event.get_place_handle()
|
|
|
|
if ph:
|
|
|
|
place = self.database.get_place_from_handle(ph).get_title()
|
|
|
|
else:
|
|
|
|
place = u''
|
|
|
|
|
|
|
|
self.doc.start_paragraph('DAR-MoreDetails')
|
|
|
|
evtName = str( event.get_type() )
|
|
|
|
if date and place:
|
2007-06-13 09:43:00 +05:30
|
|
|
text += _('%(event_name)s: %(date)s, %(place)s') % {
|
|
|
|
'event_name' : _(evtName),
|
|
|
|
'date' : date,
|
|
|
|
'place' : place }
|
2006-11-14 10:09:55 +05:30
|
|
|
elif date:
|
2007-06-13 09:43:00 +05:30
|
|
|
text += _('%(event_name)s: %(date)s') % {
|
|
|
|
'event_name' : _(evtName),
|
|
|
|
'date' : date}
|
2006-11-14 10:09:55 +05:30
|
|
|
elif place:
|
2007-06-19 10:02:06 +05:30
|
|
|
text += _('%(event_name)s: %(place)s') % {
|
2007-06-13 09:43:00 +05:30
|
|
|
'event_name' : _(evtName),
|
|
|
|
'place' : place }
|
2006-11-14 10:09:55 +05:30
|
|
|
else:
|
2007-06-13 09:43:00 +05:30
|
|
|
text += _('%(event_name)s: ') % {'event_name' : _(evtName)}
|
|
|
|
|
2006-11-14 10:09:55 +05:30
|
|
|
if event.get_description():
|
2007-06-13 09:43:00 +05:30
|
|
|
if text:
|
|
|
|
text += ". "
|
|
|
|
text += event.get_description()
|
|
|
|
|
|
|
|
if text:
|
|
|
|
text += _('%(endnotes)s.') % { 'endnotes' : self.endnotes(event) }
|
|
|
|
|
|
|
|
self.doc.write_text(text)
|
2007-08-12 09:04:28 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_attrs:
|
2007-08-12 09:04:28 +05:30
|
|
|
text = ""
|
2007-11-04 03:38:34 +05:30
|
|
|
attr_list = event.get_attribute_list()
|
|
|
|
attr_list.extend(event_ref.get_attribute_list())
|
|
|
|
for attr in attr_list:
|
2007-08-12 09:04:28 +05:30
|
|
|
if text:
|
|
|
|
text += "; "
|
|
|
|
text += _("%(type)s: %(value)s%(endnotes)s") % {
|
|
|
|
'type' : attr.get_type(),
|
|
|
|
'value' : attr.get_value(),
|
|
|
|
'endnotes' : self.endnotes(attr) }
|
2007-11-04 03:38:34 +05:30
|
|
|
text = " " + text
|
2007-08-12 09:04:28 +05:30
|
|
|
self.doc.write_text(text)
|
|
|
|
|
2006-11-14 10:09:55 +05:30
|
|
|
self.doc.end_paragraph()
|
2007-11-04 03:38:34 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.includenotes:
|
2007-11-04 03:38:34 +05:30
|
|
|
# if the event or event reference has a note attached to it,
|
|
|
|
# get the text and format it correctly
|
|
|
|
notelist = event.get_note_list()
|
|
|
|
notelist.extend(event_ref.get_note_list())
|
|
|
|
for notehandle in notelist:
|
|
|
|
note = self.database.get_note_from_handle(notehandle)
|
|
|
|
self.doc.start_paragraph('DAR-MoreDetails')
|
|
|
|
self.doc.write_text(note.get())
|
|
|
|
self.doc.end_paragraph()
|
2006-11-14 10:09:55 +05:30
|
|
|
|
2005-02-01 10:38:16 +05:30
|
|
|
def write_parents(self, person, firstName):
|
|
|
|
family_handle = person.get_main_parents_family_handle()
|
|
|
|
if family_handle:
|
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
|
|
|
mother_handle = family.get_mother_handle()
|
|
|
|
father_handle = family.get_father_handle()
|
|
|
|
if mother_handle:
|
|
|
|
mother = self.database.get_person_from_handle(mother_handle)
|
2005-02-22 09:13:53 +05:30
|
|
|
mother_name = _nd.display_name(mother.get_primary_name())
|
2006-06-03 09:02:26 +05:30
|
|
|
mother_mark = ReportUtils.get_person_mark(self.database, mother)
|
2005-01-01 07:47:17 +05:30
|
|
|
else:
|
2005-02-01 10:38:16 +05:30
|
|
|
mother_name = ""
|
2006-06-03 09:02:26 +05:30
|
|
|
mother_mark = ""
|
2005-02-01 10:38:16 +05:30
|
|
|
if father_handle:
|
|
|
|
father = self.database.get_person_from_handle(father_handle)
|
2005-02-22 09:13:53 +05:30
|
|
|
father_name = _nd.display_name(father.get_primary_name())
|
2006-06-03 09:02:26 +05:30
|
|
|
father_mark = ReportUtils.get_person_mark(self.database, father)
|
2005-02-01 10:38:16 +05:30
|
|
|
else:
|
|
|
|
father_name = ""
|
2006-06-03 09:02:26 +05:30
|
|
|
father_mark = ""
|
2005-02-01 10:38:16 +05:30
|
|
|
|
2005-12-06 12:08:09 +05:30
|
|
|
text = ReportUtils.child_str(person, father_name, mother_name,
|
2006-03-30 08:47:33 +05:30
|
|
|
bool(person.get_death_ref()),
|
2008-01-06 11:43:37 +05:30
|
|
|
firstName,self.verbose)
|
2005-02-01 10:38:16 +05:30
|
|
|
if text:
|
|
|
|
self.doc.write_text(text)
|
2006-06-03 09:02:26 +05:30
|
|
|
if father_mark:
|
|
|
|
self.doc.write_text("",father_mark)
|
|
|
|
if mother_mark:
|
|
|
|
self.doc.write_text("",mother_mark)
|
2005-02-01 10:38:16 +05:30
|
|
|
|
|
|
|
def write_marriage(self, person):
|
|
|
|
"""
|
|
|
|
Output marriage sentence.
|
|
|
|
"""
|
|
|
|
is_first = True
|
|
|
|
for family_handle in person.get_family_handle_list():
|
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
|
|
|
spouse_handle = ReportUtils.find_spouse(person,family)
|
|
|
|
spouse = self.database.get_person_from_handle(spouse_handle)
|
|
|
|
text = ""
|
2006-06-03 09:02:26 +05:30
|
|
|
spouse_mark = ReportUtils.get_person_mark(self.database, spouse)
|
2007-08-20 07:58:41 +05:30
|
|
|
|
|
|
|
text = ReportUtils.married_str(self.database,person,family,
|
2008-01-06 11:43:37 +05:30
|
|
|
self.verbose,
|
2007-08-20 07:58:41 +05:30
|
|
|
self.endnotes,
|
2005-02-01 10:38:16 +05:30
|
|
|
self.EMPTY_DATE,self.EMPTY_PLACE,
|
|
|
|
is_first)
|
2007-08-20 07:58:41 +05:30
|
|
|
|
2005-02-01 10:38:16 +05:30
|
|
|
if text:
|
2006-06-03 09:02:26 +05:30
|
|
|
self.doc.write_text(text,spouse_mark)
|
2005-02-01 10:38:16 +05:30
|
|
|
is_first = False
|
2005-01-01 07:47:17 +05:30
|
|
|
|
|
|
|
def write_children(self, family):
|
2005-02-02 10:39:07 +05:30
|
|
|
""" List children.
|
2002-10-20 19:55:16 +05:30
|
|
|
"""
|
|
|
|
|
2006-04-22 10:43:21 +05:30
|
|
|
if not family.get_child_ref_list():
|
2005-02-02 10:39:07 +05:30
|
|
|
return
|
2004-04-26 09:47:01 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
mother_handle = family.get_mother_handle()
|
|
|
|
if mother_handle:
|
|
|
|
mother = self.database.get_person_from_handle(mother_handle)
|
|
|
|
mother_name = _nd.display(mother)
|
|
|
|
else:
|
|
|
|
mother_name = _("unknown")
|
2004-04-26 09:47:01 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
father_handle = family.get_father_handle()
|
|
|
|
if father_handle:
|
|
|
|
father = self.database.get_person_from_handle(father_handle)
|
|
|
|
father_name = _nd.display(father)
|
|
|
|
else:
|
|
|
|
father_name = _("unknown")
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
self.doc.start_paragraph("DAR-ChildTitle")
|
2007-12-24 03:04:36 +05:30
|
|
|
self.doc.write_text(
|
|
|
|
_("Children of %(mother_name)s and %(father_name)s") %
|
2008-01-06 11:43:37 +05:30
|
|
|
{'father_name': father_name,
|
|
|
|
'mother_name': mother_name} )
|
2005-02-02 10:39:07 +05:30
|
|
|
self.doc.end_paragraph()
|
2005-01-01 07:47:17 +05:30
|
|
|
|
2005-12-06 12:08:09 +05:30
|
|
|
cnt = 1
|
2006-04-22 10:43:21 +05:30
|
|
|
for child_ref in family.get_child_ref_list():
|
|
|
|
child_handle = child_ref.ref
|
2005-02-02 10:39:07 +05:30
|
|
|
child = self.database.get_person_from_handle(child_handle)
|
|
|
|
child_name = _nd.display(child)
|
2006-06-03 09:02:26 +05:30
|
|
|
child_mark = ReportUtils.get_person_mark(self.database,child)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.childref and self.prev_gen_handles.get(child_handle):
|
2005-12-06 12:08:09 +05:30
|
|
|
value = str(self.prev_gen_handles.get(child_handle))
|
|
|
|
child_name += " [%s]" % value
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2005-12-06 12:08:09 +05:30
|
|
|
self.doc.start_paragraph("DAR-ChildList",ReportUtils.roman(cnt).lower() + ".")
|
|
|
|
cnt += 1
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2006-06-03 09:02:26 +05:30
|
|
|
self.doc.write_text("%s. " % child_name,child_mark)
|
2008-01-06 11:43:37 +05:30
|
|
|
self.doc.write_text(
|
|
|
|
ReportUtils.born_str(self.database, child, 0,
|
|
|
|
self.verbose, self.EMPTY_DATE, self.EMPTY_PLACE))
|
|
|
|
self.doc.write_text(
|
|
|
|
ReportUtils.died_str(self.database, child, 0,
|
|
|
|
self.verbose, self.EMPTY_DATE, self.EMPTY_PLACE))
|
2005-12-06 12:08:09 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
self.doc.end_paragraph()
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2006-11-14 10:09:55 +05:30
|
|
|
def write_family_events(self,family):
|
|
|
|
|
|
|
|
if not family.get_event_ref_list():
|
|
|
|
return
|
|
|
|
|
|
|
|
mother_handle = family.get_mother_handle()
|
|
|
|
if mother_handle:
|
|
|
|
mother = self.database.get_person_from_handle(mother_handle)
|
|
|
|
mother_name = _nd.display(mother)
|
|
|
|
else:
|
|
|
|
mother_name = _("unknown")
|
|
|
|
|
|
|
|
father_handle = family.get_father_handle()
|
|
|
|
if father_handle:
|
|
|
|
father = self.database.get_person_from_handle(father_handle)
|
|
|
|
father_name = _nd.display(father)
|
|
|
|
else:
|
|
|
|
father_name = _("unknown")
|
|
|
|
|
|
|
|
first = 1
|
|
|
|
for event_ref in family.get_event_ref_list():
|
|
|
|
if first:
|
|
|
|
self.doc.start_paragraph('DAR-MoreHeader')
|
|
|
|
self.doc.write_text(
|
|
|
|
_('More about %(mother_name)s and %(father_name)s:') % {
|
|
|
|
'mother_name' : mother_name,
|
|
|
|
'father_name' : father_name })
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
first = 0
|
|
|
|
self.write_event(event_ref)
|
|
|
|
|
2005-01-01 07:47:17 +05:30
|
|
|
def write_mate(self, mate):
|
2002-10-20 19:55:16 +05:30
|
|
|
"""Output birth, death, parentage, marriage and notes information """
|
2008-06-02 02:53:50 +05:30
|
|
|
ind = None
|
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
for family_handle in mate.get_family_handle_list():
|
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
|
|
|
ind_handle = None
|
2006-08-12 09:07:05 +05:30
|
|
|
has_info = False
|
2007-10-08 22:11:39 +05:30
|
|
|
if mate.get_gender() == gen.lib.Person.MALE:
|
2005-02-02 10:39:07 +05:30
|
|
|
ind_handle = family.get_mother_handle()
|
|
|
|
else:
|
|
|
|
ind_handle = family.get_father_handle()
|
|
|
|
if ind_handle:
|
|
|
|
ind = self.database.get_person_from_handle(ind_handle)
|
2006-11-22 10:13:33 +05:30
|
|
|
for event_ref in ind.get_primary_event_ref_list():
|
2006-08-12 09:07:05 +05:30
|
|
|
event = self.database.get_event_from_handle(event_ref.ref)
|
|
|
|
if event:
|
|
|
|
etype = event.get_type()
|
2007-10-08 22:11:39 +05:30
|
|
|
if etype == gen.lib.EventType.BURIAL or \
|
|
|
|
etype == gen.lib.EventType.BIRTH or \
|
|
|
|
etype == gen.lib.EventType.DEATH :
|
2006-08-12 09:07:05 +05:30
|
|
|
has_info = True
|
|
|
|
break
|
|
|
|
if not has_info:
|
|
|
|
family_handle = ind.get_main_parents_family_handle()
|
|
|
|
if family_handle:
|
|
|
|
f = self.database.get_family_from_handle(family_handle)
|
|
|
|
if f.get_mother_handle() or f.get_father_handle():
|
|
|
|
has_info = True
|
2005-02-01 10:38:16 +05:30
|
|
|
|
2008-06-02 02:53:50 +05:30
|
|
|
if has_info:
|
2005-02-02 10:39:07 +05:30
|
|
|
self.doc.start_paragraph("DAR-Entry")
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2008-06-02 02:53:50 +05:30
|
|
|
person_name = _nd.display(ind)
|
|
|
|
person_mark = ReportUtils.get_person_mark(self.database, ind)
|
|
|
|
self.doc.write_text(person_name, person_mark)
|
|
|
|
|
|
|
|
first_name = ReportUtils.common_name(ind, self.usecall)
|
|
|
|
print_name = first_name
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2008-02-11 03:39:35 +05:30
|
|
|
text = ReportUtils.born_str(self.database, ind, print_name,
|
|
|
|
self.verbose, self.EMPTY_DATE, self.EMPTY_PLACE)
|
2005-02-02 10:39:07 +05:30
|
|
|
if text:
|
|
|
|
self.doc.write_text(text)
|
2008-06-02 02:53:50 +05:30
|
|
|
print_name = 0
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2008-06-02 02:53:50 +05:30
|
|
|
age, units = self.calc_age(ind)
|
|
|
|
text = ReportUtils.died_str(self.database, ind, print_name,
|
|
|
|
self.verbose, self.EMPTY_DATE, self.EMPTY_PLACE,
|
|
|
|
age, units)
|
2005-02-02 10:39:07 +05:30
|
|
|
if text:
|
|
|
|
self.doc.write_text(text)
|
2008-06-02 02:53:50 +05:30
|
|
|
print_name = 0
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2008-06-02 02:53:50 +05:30
|
|
|
text = ReportUtils.buried_str(self.database, ind, print_name,
|
|
|
|
self.EMPTY_DATE, self.EMPTY_PLACE)
|
2005-02-02 10:39:07 +05:30
|
|
|
if text:
|
|
|
|
self.doc.write_text(text)
|
2008-06-02 02:53:50 +05:30
|
|
|
print_name = 0
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2006-08-12 09:07:05 +05:30
|
|
|
if print_name == 0:
|
2008-06-02 02:53:50 +05:30
|
|
|
print_name = first_name
|
2006-08-12 09:07:05 +05:30
|
|
|
self.write_parents(ind, print_name)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
2008-06-02 02:53:50 +05:30
|
|
|
if has_info and mate.get_gender() == gen.lib.Person.MALE:
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.listchildren:
|
2005-02-02 10:39:07 +05:30
|
|
|
self.write_children(family)
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_events:
|
2006-11-14 10:09:55 +05:30
|
|
|
self.write_family_events(family)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
def calc_age(self,ind):
|
2005-02-01 10:38:16 +05:30
|
|
|
"""
|
|
|
|
Calulate age.
|
|
|
|
|
|
|
|
Returns a tuple (age,units) where units is an integer representing
|
|
|
|
time units:
|
|
|
|
no age info: 0
|
|
|
|
years: 1
|
|
|
|
months: 2
|
|
|
|
days: 3
|
|
|
|
"""
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.calcageflag:
|
2005-02-02 10:39:07 +05:30
|
|
|
return ReportUtils.old_calc_age(self.database,ind)
|
2005-02-01 10:38:16 +05:30
|
|
|
else:
|
2005-02-02 10:39:07 +05:30
|
|
|
return (0,0)
|
2003-07-07 11:45:05 +05:30
|
|
|
|
2008-02-24 19:25:55 +05:30
|
|
|
def endnotes(self, obj):
|
2008-01-23 11:11:46 +05:30
|
|
|
if not obj or not self.inc_sources:
|
2005-08-18 11:28:28 +05:30
|
|
|
return ""
|
2007-06-13 09:43:00 +05:30
|
|
|
|
2008-02-24 19:25:55 +05:30
|
|
|
txt = Endnotes.cite_source(self.bibli, obj)
|
2007-07-21 18:53:32 +05:30
|
|
|
if txt:
|
|
|
|
txt = '<super>' + txt + '</super>'
|
|
|
|
return txt
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2003-07-07 11:45:05 +05:30
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
2007-12-28 10:42:30 +05:30
|
|
|
# DetAncestorOptions
|
2003-07-07 11:45:05 +05:30
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2007-12-28 10:42:30 +05:30
|
|
|
class DetAncestorOptions(MenuReportOptions):
|
2005-01-01 07:47:17 +05:30
|
|
|
|
|
|
|
"""
|
|
|
|
Defines options and provides handling interface.
|
|
|
|
"""
|
|
|
|
|
2008-01-24 18:20:33 +05:30
|
|
|
def __init__(self, name, dbase):
|
|
|
|
MenuReportOptions.__init__(self, name, dbase)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2008-01-24 18:20:33 +05:30
|
|
|
def add_menu_options(self, menu):
|
2007-12-28 10:42:30 +05:30
|
|
|
category_name = _("Report Options")
|
|
|
|
|
2008-01-18 11:09:50 +05:30
|
|
|
pid = PersonOption(_("Center Person"))
|
|
|
|
pid.set_help(_("The center person for the report"))
|
|
|
|
menu.add_option(category_name, "pid", pid)
|
|
|
|
|
2007-12-28 10:42:30 +05:30
|
|
|
gen = NumberOption(_("Generations"),10,1,100)
|
|
|
|
gen.set_help(_("The number of generations to include in the report"))
|
|
|
|
menu.add_option(category_name,"gen",gen)
|
|
|
|
|
|
|
|
pagebbg = BooleanOption(_("Page break between generations"),False)
|
|
|
|
pagebbg.set_help(
|
|
|
|
_("Whether to start a new page after each generation."))
|
|
|
|
menu.add_option(category_name,"pagebbg",pagebbg)
|
|
|
|
|
|
|
|
category_name = _("Content")
|
|
|
|
|
|
|
|
usecall = BooleanOption(_("Use callname for common name"),False)
|
|
|
|
usecall.set_help(_("Whether to use the call name as the first name."))
|
|
|
|
menu.add_option(category_name,"usecall",usecall)
|
|
|
|
|
|
|
|
fulldates = BooleanOption(
|
|
|
|
_("Use full dates instead of only the year"),True)
|
|
|
|
fulldates.set_help(_("Whether to use full dates instead of just year."))
|
|
|
|
menu.add_option(category_name,"fulldates",fulldates)
|
|
|
|
|
|
|
|
listc = BooleanOption(_("List children"),True)
|
|
|
|
listc.set_help(_("Whether to list children."))
|
|
|
|
menu.add_option(category_name,"listc",listc)
|
|
|
|
|
|
|
|
computeage = BooleanOption(_("Compute age"),True)
|
|
|
|
computeage.set_help(_("Whether to compute age."))
|
|
|
|
menu.add_option(category_name,"computeage",computeage)
|
|
|
|
|
|
|
|
omitda = BooleanOption(_("Omit duplicate ancestors"),True)
|
|
|
|
omitda.set_help(_("Whether to omit duplicate ancestors."))
|
2008-02-24 19:25:55 +05:30
|
|
|
menu.add_option(category_name,"omitda", omitda)
|
2008-01-06 11:43:37 +05:30
|
|
|
|
|
|
|
verbose = BooleanOption(_("Use Complete Sentences"),True)
|
|
|
|
verbose.set_help(
|
|
|
|
_("Whether to use complete sentences or succinct language."))
|
|
|
|
menu.add_option(category_name,"verbose",verbose)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
|
|
|
desref = BooleanOption(_("Add descendant reference in child list"),True)
|
|
|
|
desref.set_help(
|
|
|
|
_("Whether to add descendant references in child list."))
|
|
|
|
menu.add_option(category_name,"desref",desref)
|
|
|
|
|
|
|
|
category_name = _("Include")
|
|
|
|
|
|
|
|
incnotes = BooleanOption(_("Include notes"),True)
|
|
|
|
incnotes.set_help(_("Whether to include notes."))
|
|
|
|
menu.add_option(category_name,"incnotes",incnotes)
|
|
|
|
|
|
|
|
incattrs = BooleanOption(_("Include attributes"),False)
|
|
|
|
incattrs.set_help(_("Whether to include attributes."))
|
|
|
|
menu.add_option(category_name,"incattrs",incattrs)
|
|
|
|
|
|
|
|
incphotos = BooleanOption(_("Include Photo/Images from Gallery"),False)
|
|
|
|
incphotos.set_help(_("Whether to include images."))
|
|
|
|
menu.add_option(category_name,"incphotos",incphotos)
|
|
|
|
|
|
|
|
incnames = BooleanOption(_("Include alternative names"),False)
|
|
|
|
incnames.set_help(_("Whether to include other names."))
|
|
|
|
menu.add_option(category_name,"incnames",incnames)
|
|
|
|
|
|
|
|
incevents = BooleanOption(_("Include events"),False)
|
|
|
|
incevents.set_help(_("Whether to include events."))
|
|
|
|
menu.add_option(category_name,"incevents",incevents)
|
|
|
|
|
|
|
|
incaddresses = BooleanOption(_("Include addresses"),False)
|
|
|
|
incaddresses.set_help(_("Whether to include addresses."))
|
|
|
|
menu.add_option(category_name,"incaddresses",incaddresses)
|
|
|
|
|
|
|
|
incsources = BooleanOption(_("Include sources"),False)
|
|
|
|
incsources.set_help(_("Whether to include source references."))
|
|
|
|
menu.add_option(category_name,"incsources",incsources)
|
|
|
|
|
|
|
|
category_name = _("Missing information")
|
|
|
|
|
|
|
|
repplace = BooleanOption(_("Replace missing places with ______"),False)
|
|
|
|
repplace.set_help(_("Whether to replace missing Places with blanks."))
|
|
|
|
menu.add_option(category_name,"repplace",repplace)
|
|
|
|
|
|
|
|
repdate = BooleanOption(_("Replace missing dates with ______"),False)
|
|
|
|
repdate.set_help(_("Whether to replace missing Dates with blanks."))
|
|
|
|
menu.add_option(category_name,"repdate",repdate)
|
2005-01-01 07:47:17 +05:30
|
|
|
|
|
|
|
def make_default_style(self,default_style):
|
|
|
|
"""Make the default output style for the Detailed Ancestral Report"""
|
|
|
|
font = BaseDoc.FontStyle()
|
|
|
|
font.set(face=BaseDoc.FONT_SANS_SERIF,size=16,bold=1)
|
|
|
|
para = BaseDoc.ParagraphStyle()
|
|
|
|
para.set_font(font)
|
|
|
|
para.set_header_level(1)
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2006-06-04 09:56:28 +05:30
|
|
|
para.set_alignment(BaseDoc.PARA_ALIGN_CENTER)
|
2005-01-01 07:47:17 +05:30
|
|
|
para.set_description(_('The style used for the title of the page.'))
|
2007-04-23 17:16:26 +05:30
|
|
|
default_style.add_paragraph_style("DAR-Title",para)
|
2005-01-01 07:47:17 +05:30
|
|
|
|
|
|
|
font = BaseDoc.FontStyle()
|
|
|
|
font.set(face=BaseDoc.FONT_SANS_SERIF,size=14,italic=1)
|
|
|
|
para = BaseDoc.ParagraphStyle()
|
|
|
|
para.set_font(font)
|
|
|
|
para.set_header_level(2)
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2005-01-01 07:47:17 +05:30
|
|
|
para.set_description(_('The style used for the generation header.'))
|
2007-04-23 17:16:26 +05:30
|
|
|
default_style.add_paragraph_style("DAR-Generation",para)
|
2005-01-01 07:47:17 +05:30
|
|
|
|
|
|
|
font = BaseDoc.FontStyle()
|
2005-12-06 12:08:09 +05:30
|
|
|
font.set(face=BaseDoc.FONT_SANS_SERIF,size=10,italic=0, bold=1)
|
2005-01-01 07:47:17 +05:30
|
|
|
para = BaseDoc.ParagraphStyle()
|
|
|
|
para.set_font(font)
|
|
|
|
para.set_left_margin(1.0) # in centimeters
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2005-01-01 07:47:17 +05:30
|
|
|
para.set_description(_('The style used for the children list title.'))
|
2007-04-23 17:16:26 +05:30
|
|
|
default_style.add_paragraph_style("DAR-ChildTitle",para)
|
2005-01-01 07:47:17 +05:30
|
|
|
|
|
|
|
font = BaseDoc.FontStyle()
|
2005-12-06 12:08:09 +05:30
|
|
|
font.set(size=10)
|
2005-01-01 07:47:17 +05:30
|
|
|
para = BaseDoc.ParagraphStyle()
|
|
|
|
para.set_font(font)
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set(first_indent=-0.75,lmargin=1.75)
|
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2005-01-01 07:47:17 +05:30
|
|
|
para.set_description(_('The style used for the children list.'))
|
2007-04-23 17:16:26 +05:30
|
|
|
default_style.add_paragraph_style("DAR-ChildList",para)
|
2005-01-01 07:47:17 +05:30
|
|
|
|
2005-12-06 12:08:09 +05:30
|
|
|
font = BaseDoc.FontStyle()
|
|
|
|
font.set(face=BaseDoc.FONT_SANS_SERIF,size=10,italic=0, bold=1)
|
2005-01-01 07:47:17 +05:30
|
|
|
para = BaseDoc.ParagraphStyle()
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set_font(font)
|
|
|
|
para.set(first_indent=0.0,lmargin=1.0)
|
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2007-04-23 17:16:26 +05:30
|
|
|
default_style.add_paragraph_style("DAR-NoteHeader",para)
|
2005-01-01 07:47:17 +05:30
|
|
|
|
|
|
|
para = BaseDoc.ParagraphStyle()
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set(lmargin=1.0)
|
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2005-01-01 07:47:17 +05:30
|
|
|
para.set_description(_('The basic style used for the text display.'))
|
2007-04-23 17:16:26 +05:30
|
|
|
default_style.add_paragraph_style("DAR-Entry",para)
|
2005-01-01 07:47:17 +05:30
|
|
|
|
|
|
|
para = BaseDoc.ParagraphStyle()
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set(first_indent=-1.0,lmargin=1.0)
|
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2005-01-01 07:47:17 +05:30
|
|
|
para.set_description(_('The style used for the first personal entry.'))
|
2007-04-23 17:16:26 +05:30
|
|
|
default_style.add_paragraph_style("DAR-First-Entry",para)
|
2005-01-01 07:47:17 +05:30
|
|
|
|
2005-08-18 11:28:28 +05:30
|
|
|
font = BaseDoc.FontStyle()
|
2005-12-06 12:08:09 +05:30
|
|
|
font.set(size=10,face=BaseDoc.FONT_SANS_SERIF,bold=1)
|
2005-08-18 11:28:28 +05:30
|
|
|
para = BaseDoc.ParagraphStyle()
|
|
|
|
para.set_font(font)
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set(first_indent=0.0,lmargin=1.0)
|
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2005-08-18 11:28:28 +05:30
|
|
|
para.set_description(_('The style used for the More About header.'))
|
2007-04-23 17:16:26 +05:30
|
|
|
default_style.add_paragraph_style("DAR-MoreHeader",para)
|
2005-08-18 11:28:28 +05:30
|
|
|
|
|
|
|
font = BaseDoc.FontStyle()
|
2005-12-06 12:08:09 +05:30
|
|
|
font.set(face=BaseDoc.FONT_SERIF,size=10)
|
2005-08-18 11:28:28 +05:30
|
|
|
para = BaseDoc.ParagraphStyle()
|
|
|
|
para.set_font(font)
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set(first_indent=0.0,lmargin=1.0)
|
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2005-08-18 11:28:28 +05:30
|
|
|
para.set_description(_('The style used for additional detail data.'))
|
2007-04-23 17:16:26 +05:30
|
|
|
default_style.add_paragraph_style("DAR-MoreDetails",para)
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2007-06-13 09:43:00 +05:30
|
|
|
Endnotes.add_endnote_styles(default_style)
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2008-05-19 00:54:28 +05:30
|
|
|
pmgr = PluginManager.get_instance()
|
|
|
|
pmgr.register_report(
|
2005-01-01 07:47:17 +05:30
|
|
|
name = 'det_ancestor_report',
|
2006-06-01 10:09:40 +05:30
|
|
|
category = CATEGORY_TEXT,
|
2005-01-01 07:47:17 +05:30
|
|
|
report_class = DetAncestorReport,
|
|
|
|
options_class = DetAncestorOptions,
|
2006-06-01 10:09:40 +05:30
|
|
|
modes = MODE_GUI | MODE_BKI | MODE_CLI,
|
2008-03-02 04:17:48 +05:30
|
|
|
translated_name = _("Detailed Ancestral Report"),
|
2008-03-03 00:50:55 +05:30
|
|
|
status=(_("Stable")),
|
2002-10-20 19:55:16 +05:30
|
|
|
description= _("Produces a detailed ancestral report"),
|
2003-02-08 22:58:41 +05:30
|
|
|
author_name="Bruce DeGrasse",
|
|
|
|
author_email="bdegrasse1@attbi.com"
|
2002-10-20 19:55:16 +05:30
|
|
|
)
|