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
|
2009-11-03 10:55:15 +05:30
|
|
|
# Copyright (C) 2007-2009 Brian G. Matherly
|
2007-07-24 17:23:35 +05:30
|
|
|
# Copyright (C) 2007 Robert Cawley <rjc@cawley.id.au>
|
2009-02-02 18:49:17 +05:30
|
|
|
# Copyright (C) 2008-2009 James Friedmann <jfriedmannj@gmail.com>
|
2009-02-11 04:37:35 +05:30
|
|
|
# Copyright (C) 2009 Benny Malengier <benny.malengier@gramps-project.org>
|
2010-05-01 09:42:42 +05:30
|
|
|
# Copyright (C) 2010 Jakim Friant
|
2010-11-01 20:30:12 +05:30
|
|
|
# Copyright (C) 2010 Vlada Peri\u0107
|
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 Descendant Report"""
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2005-01-02 01:28:53 +05:30
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# standard python modules
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2010-01-18 10:12:17 +05:30
|
|
|
from gen.ggettext import gettext as _
|
2005-01-02 01:28:53 +05:30
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GRAMPS modules
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2010-01-14 09:38:04 +05:30
|
|
|
from gen.display.name import displayer as _nd
|
2009-08-14 12:44:25 +05:30
|
|
|
from Errors import ReportError
|
2010-04-17 02:29:10 +05:30
|
|
|
from gen.lib import FamilyRelType, Person, NoteType
|
2009-10-18 06:58:49 +05:30
|
|
|
from gen.plug.menu import (BooleanOption, NumberOption, PersonOption,
|
|
|
|
EnumeratedListOption)
|
2009-05-31 20:29:56 +05:30
|
|
|
from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
|
|
|
FONT_SANS_SERIF, FONT_SERIF,
|
|
|
|
INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
|
2010-05-01 09:42:42 +05:30
|
|
|
from gen.plug.report import (Report, Bibliography)
|
|
|
|
from gen.plug.report import endnotes
|
|
|
|
from gen.plug.report import utils as ReportUtils
|
|
|
|
from gui.plug.report import MenuReportOptions
|
|
|
|
|
2006-04-04 09:44:51 +05:30
|
|
|
import DateHandler
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2009-11-01 03:06:57 +05:30
|
|
|
from libnarrate import Narrator
|
2010-11-01 20:30:12 +05:30
|
|
|
import TransUtils
|
|
|
|
from libtranslate import Translator, get_language_string
|
2009-11-01 03:06:57 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Constants
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
EMPTY_ENTRY = "_____________"
|
2005-12-06 12:08:09 +05:30
|
|
|
HENRY = "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
2002-10-20 19:55:16 +05:30
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2006-06-01 10:09:40 +05:30
|
|
|
class DetDescendantReport(Report):
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2008-02-20 10:22:10 +05:30
|
|
|
def __init__(self, database, options_class):
|
2005-01-02 01:28:53 +05:30
|
|
|
"""
|
2008-02-24 19:25:55 +05:30
|
|
|
Create the DetDescendantReport object that produces the report.
|
2005-01-02 01:28:53 +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.
|
2010-05-26 02:51:52 +05:30
|
|
|
pageben - Whether to include page break before End Notes.
|
2010-04-07 01:30:50 +05:30
|
|
|
fulldates - Whether to use full dates instead of just year.
|
|
|
|
listc - Whether to list children.
|
|
|
|
incnotes - Whether to include notes.
|
|
|
|
usecall - Whether to use the call name as the first name.
|
|
|
|
repplace - Whether to replace missing Places with ___________.
|
|
|
|
repdate - Whether to replace missing Dates with ___________.
|
|
|
|
computeage - Whether to compute age.
|
|
|
|
omitda - Whether to omit duplicate ancestors (e.g. when distant cousins marry).
|
2009-10-18 06:58:49 +05:30
|
|
|
verbose - Whether to use complete sentences.
|
2010-04-07 01:30:50 +05:30
|
|
|
numbering - The descendancy numbering system to be utilized.
|
|
|
|
desref - Whether to add descendant references in child list.
|
|
|
|
incphotos - Whether to include images.
|
|
|
|
incnames - Whether to include other names.
|
|
|
|
incevents - Whether to include events.
|
|
|
|
incaddresses - Whether to include addresses.
|
|
|
|
incsrcnotes - Whether to include source notes in the Endnotes section. Only works if Include sources is selected.
|
|
|
|
incmates - Whether to include information about spouses
|
|
|
|
incattrs - Whether to include attributes
|
|
|
|
incpaths - Whether to include the path of descendancy from the start-person to each descendant.
|
|
|
|
incssign - Whether to include a sign ('+') before the descendant number in the child-list to indicate a child has succession.
|
2008-01-06 02:12:05 +05:30
|
|
|
pid - The Gramps ID of the center person for the report.
|
2005-01-02 01:28:53 +05:30
|
|
|
"""
|
2008-02-20 10:22:10 +05:30
|
|
|
Report.__init__(self, database, options_class)
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
self.map = {}
|
2005-01-02 01:28:53 +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()
|
2010-05-26 02:51:52 +05:30
|
|
|
self.pgbrkenotes = menu.get_option_by_name('pageben').get_value()
|
2008-01-23 11:11:46 +05:30
|
|
|
self.fulldate = menu.get_option_by_name('fulldates').get_value()
|
2010-08-12 11:29:17 +05:30
|
|
|
use_fulldate = self.fulldate
|
2008-01-23 11:11:46 +05:30
|
|
|
self.listchildren = menu.get_option_by_name('listc').get_value()
|
|
|
|
self.inc_notes = menu.get_option_by_name('incnotes').get_value()
|
2009-11-03 10:55:15 +05:30
|
|
|
use_call = menu.get_option_by_name('usecall').get_value()
|
2008-01-23 11:11:46 +05:30
|
|
|
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.dubperson = menu.get_option_by_name('omitda').get_value()
|
|
|
|
self.verbose = menu.get_option_by_name('verbose').get_value()
|
2009-10-18 06:58:49 +05:30
|
|
|
self.numbering = menu.get_option_by_name('numbering').get_value()
|
2008-01-23 11:11:46 +05:30
|
|
|
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()
|
2009-08-14 16:58:28 +05:30
|
|
|
self.inc_srcnotes = menu.get_option_by_name('incsrcnotes').get_value()
|
2008-01-23 11:11:46 +05:30
|
|
|
self.inc_mates = menu.get_option_by_name('incmates').get_value()
|
|
|
|
self.inc_attrs = menu.get_option_by_name('incattrs').get_value()
|
2009-05-19 15:10:08 +05:30
|
|
|
self.inc_paths = menu.get_option_by_name('incpaths').get_value()
|
2010-02-14 07:07:55 +05:30
|
|
|
self.inc_ssign = menu.get_option_by_name('incssign').get_value()
|
2008-01-23 11:11:46 +05:30
|
|
|
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)
|
2009-08-14 12:44:25 +05:30
|
|
|
if (self.center_person == None) :
|
|
|
|
raise ReportError(_("Person %s is not in the Database") % pid )
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
self.gen_handles = {}
|
2008-01-23 11:11:46 +05:30
|
|
|
self.prev_gen_handles = {}
|
2005-02-02 10:39:07 +05:30
|
|
|
self.gen_keys = []
|
2009-05-19 15:20:40 +05:30
|
|
|
self.dnumber = {}
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if blankdate:
|
2009-11-01 03:06:57 +05:30
|
|
|
empty_date = EMPTY_ENTRY
|
2005-02-02 10:39:07 +05:30
|
|
|
else:
|
2009-11-01 03:06:57 +05:30
|
|
|
empty_date = ""
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if blankplace:
|
2009-11-01 03:06:57 +05:30
|
|
|
empty_place = EMPTY_ENTRY
|
2005-02-02 10:39:07 +05:30
|
|
|
else:
|
2009-11-01 03:06:57 +05:30
|
|
|
empty_place = ""
|
2010-11-01 20:30:12 +05:30
|
|
|
|
|
|
|
language = menu.get_option_by_name('trans').get_value()
|
|
|
|
translator = Translator(language)
|
|
|
|
self._ = translator.gettext
|
|
|
|
|
2010-08-12 11:29:17 +05:30
|
|
|
self.__narrator = Narrator(self.database, self.verbose, use_call, use_fulldate ,
|
2010-11-01 20:30:12 +05:30
|
|
|
empty_date, empty_place,
|
|
|
|
translator=translator,
|
2009-12-07 18:41:43 +05:30
|
|
|
get_endnote_numbers=self.endnotes)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2010-11-01 20:30:12 +05:30
|
|
|
self.__get_date = translator.get_date
|
|
|
|
|
2007-07-23 17:52:03 +05:30
|
|
|
self.bibli = Bibliography(Bibliography.MODE_PAGE)
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2009-05-19 15:20:40 +05:30
|
|
|
def apply_henry_filter(self,person_handle, index, pid, cur_gen=1):
|
2004-07-28 07:59:07 +05:30
|
|
|
if (not person_handle) or (cur_gen > self.max_generations):
|
2005-12-06 12:08:09 +05:30
|
|
|
return
|
2009-05-19 15:20:40 +05:30
|
|
|
self.dnumber[person_handle] = pid
|
2004-07-28 07:59:07 +05:30
|
|
|
self.map[index] = person_handle
|
2003-06-04 01:18:33 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
if len(self.gen_keys) < cur_gen:
|
|
|
|
self.gen_keys.append([index])
|
2003-06-04 01:18:33 +05:30
|
|
|
else:
|
2005-02-02 10:39:07 +05:30
|
|
|
self.gen_keys[cur_gen-1].append(index)
|
2003-06-04 01:18:33 +05:30
|
|
|
|
2004-08-07 10:46:57 +05:30
|
|
|
person = self.database.get_person_from_handle(person_handle)
|
2005-12-06 12:08:09 +05:30
|
|
|
index = 0
|
2004-07-28 07:59:07 +05:30
|
|
|
for family_handle in person.get_family_handle_list():
|
2004-08-20 03:05:16 +05:30
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
2006-04-22 10:43:21 +05:30
|
|
|
for child_ref in family.get_child_ref_list():
|
2009-05-27 02:18:09 +05:30
|
|
|
ix = max(self.map)
|
2009-05-19 15:20:40 +05:30
|
|
|
self.apply_henry_filter(child_ref.ref, ix+1,
|
2005-12-06 12:08:09 +05:30
|
|
|
pid+HENRY[index], cur_gen+1)
|
|
|
|
index += 1
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2009-10-18 06:58:49 +05:30
|
|
|
# Filter for d'Aboville numbering
|
|
|
|
def apply_daboville_filter(self,person_handle, index, pid, cur_gen=1):
|
|
|
|
if (not person_handle) or (cur_gen > self.max_generations):
|
|
|
|
return
|
|
|
|
self.dnumber[person_handle] = pid
|
|
|
|
self.map[index] = person_handle
|
|
|
|
|
|
|
|
if len(self.gen_keys) < cur_gen:
|
|
|
|
self.gen_keys.append([index])
|
|
|
|
else:
|
|
|
|
self.gen_keys[cur_gen-1].append(index)
|
|
|
|
|
|
|
|
person = self.database.get_person_from_handle(person_handle)
|
|
|
|
index = 1
|
|
|
|
for family_handle in person.get_family_handle_list():
|
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
|
|
|
for child_ref in family.get_child_ref_list():
|
|
|
|
ix = max(self.map)
|
|
|
|
self.apply_daboville_filter(child_ref.ref, ix+1,
|
|
|
|
pid+"."+str(index), cur_gen+1)
|
|
|
|
index += 1
|
|
|
|
|
2008-07-24 18:12:29 +05:30
|
|
|
# Filter for Record-style (Modified Register) numbering
|
2009-05-19 15:20:40 +05:30
|
|
|
def apply_mod_reg_filter_aux(self, person_handle, index, cur_gen=1):
|
2008-07-24 18:12:29 +05:30
|
|
|
if (not person_handle) or (cur_gen > self.max_generations):
|
|
|
|
return
|
|
|
|
self.map[index] = person_handle
|
|
|
|
|
|
|
|
if len(self.gen_keys) < cur_gen:
|
|
|
|
self.gen_keys.append([index])
|
|
|
|
else:
|
|
|
|
self.gen_keys[cur_gen-1].append(index)
|
|
|
|
|
|
|
|
person = self.database.get_person_from_handle(person_handle)
|
|
|
|
|
|
|
|
for family_handle in person.get_family_handle_list():
|
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
|
|
|
for child_ref in family.get_child_ref_list():
|
2009-05-27 02:18:09 +05:30
|
|
|
ix = max(self.map)
|
2009-05-19 15:20:40 +05:30
|
|
|
self.apply_mod_reg_filter_aux(child_ref.ref, ix+1, cur_gen+1)
|
2008-07-24 18:12:29 +05:30
|
|
|
|
2009-11-03 10:55:15 +05:30
|
|
|
def apply_mod_reg_filter(self, person_handle):
|
2009-05-19 15:20:40 +05:30
|
|
|
self.apply_mod_reg_filter_aux(person_handle, 1, 1)
|
2009-02-02 18:49:17 +05:30
|
|
|
mod_reg_number = 1
|
2008-07-24 18:12:29 +05:30
|
|
|
for generation in xrange(len(self.gen_keys)):
|
|
|
|
for key in self.gen_keys[generation]:
|
|
|
|
person_handle = self.map[key]
|
2009-05-19 15:20:40 +05:30
|
|
|
self.dnumber[person_handle] = mod_reg_number
|
2008-07-24 18:12:29 +05:30
|
|
|
mod_reg_number += 1
|
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
def write_report(self):
|
2009-02-02 18:49:17 +05:30
|
|
|
"""
|
|
|
|
This function is called by the report system and writes the report.
|
|
|
|
"""
|
2009-10-18 06:58:49 +05:30
|
|
|
if self.numbering == "Henry":
|
|
|
|
self.apply_henry_filter(self.center_person.get_handle(), 1, "1")
|
|
|
|
elif self.numbering == "d'Aboville":
|
|
|
|
self.apply_daboville_filter(self.center_person.get_handle(), 1, "1")
|
|
|
|
elif self.numbering == "Record (Modified Register)":
|
2009-05-19 15:20:40 +05:30
|
|
|
self.apply_mod_reg_filter(self.center_person.get_handle())
|
2008-07-24 18:12:29 +05:30
|
|
|
else:
|
2009-10-18 06:58:49 +05:30
|
|
|
raise AttributeError("no such numbering: '%s'" % self.numbering)
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2008-01-06 02:12:05 +05:30
|
|
|
name = _nd.display_name(self.center_person.get_primary_name())
|
2005-02-02 10:39:07 +05:30
|
|
|
|
|
|
|
self.doc.start_paragraph("DDR-Title")
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2010-11-01 20:30:12 +05:30
|
|
|
title = self._("Descendant Report for %(person_name)s") % {
|
2005-02-02 10:39:07 +05:30
|
|
|
'person_name' : name }
|
2009-05-30 03:55:44 +05:30
|
|
|
mark = IndexMark(title, INDEX_TYPE_TOC, 1)
|
2009-02-02 18:49:17 +05:30
|
|
|
self.doc.write_text(title, mark)
|
2005-02-02 10:39:07 +05:30
|
|
|
self.doc.end_paragraph()
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
generation = 0
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
for generation in xrange(len(self.gen_keys)):
|
|
|
|
if self.pgbrk and generation > 0:
|
|
|
|
self.doc.page_break()
|
|
|
|
self.doc.start_paragraph("DDR-Generation")
|
2010-11-01 20:30:12 +05:30
|
|
|
text = self._("Generation %d") % (generation+1)
|
2009-05-30 03:55:44 +05:30
|
|
|
mark = IndexMark(text, INDEX_TYPE_TOC, 2)
|
2009-02-02 18:49:17 +05:30
|
|
|
self.doc.write_text(text, mark)
|
2005-02-02 10:39:07 +05:30
|
|
|
self.doc.end_paragraph()
|
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()
|
|
|
|
self.gen_handles.clear()
|
|
|
|
|
|
|
|
for key in self.gen_keys[generation]:
|
|
|
|
person_handle = self.map[key]
|
|
|
|
self.gen_handles[person_handle] = key
|
2007-07-18 17:26:28 +05:30
|
|
|
self.write_person(key)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_sources:
|
2010-05-26 02:51:52 +05:30
|
|
|
if self.pgbrkenotes:
|
|
|
|
self.doc.page_break()
|
2010-05-01 09:42:42 +05:30
|
|
|
endnotes.write_endnotes(self.bibli, self.database, self.doc,
|
2009-08-14 16:58:28 +05:30
|
|
|
printnotes=self.inc_srcnotes)
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2009-05-19 15:10:08 +05:30
|
|
|
def write_path(self, person):
|
|
|
|
path = []
|
|
|
|
while True:
|
2009-07-15 19:54:44 +05:30
|
|
|
#person changes in the loop
|
2009-05-19 15:10:08 +05:30
|
|
|
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()
|
2009-05-19 15:20:40 +05:30
|
|
|
if mother_handle and mother_handle in self.dnumber:
|
2009-05-19 15:10:08 +05:30
|
|
|
person = self.database.get_person_from_handle(mother_handle)
|
|
|
|
person_name = _nd.display_name(person.get_primary_name())
|
|
|
|
path.append(person_name)
|
2009-05-19 15:20:40 +05:30
|
|
|
elif father_handle and father_handle in self.dnumber:
|
2009-05-19 15:10:08 +05:30
|
|
|
person = self.database.get_person_from_handle(father_handle)
|
|
|
|
person_name = _nd.display_name(person.get_primary_name())
|
|
|
|
path.append(person_name)
|
|
|
|
else:
|
|
|
|
break
|
2009-07-15 19:54:44 +05:30
|
|
|
else:
|
|
|
|
break
|
2009-05-19 15:10:08 +05:30
|
|
|
|
|
|
|
index = len(path)
|
|
|
|
|
|
|
|
if index:
|
|
|
|
self.doc.write_text("(")
|
|
|
|
|
|
|
|
for name in path:
|
|
|
|
if index == 1:
|
|
|
|
self.doc.write_text(name + "-" + str(index) + ") ")
|
|
|
|
else:
|
|
|
|
self.doc.write_text(name + "-" + str(index) + "; ")
|
|
|
|
index -= 1
|
|
|
|
|
2005-01-02 01:28:53 +05:30
|
|
|
def write_person(self, key):
|
2002-10-20 19:55:16 +05:30
|
|
|
"""Output birth, death, parentage, marriage and notes information """
|
|
|
|
|
2004-07-28 07:59:07 +05:30
|
|
|
person_handle = self.map[key]
|
2004-08-07 10:46:57 +05:30
|
|
|
person = self.database.get_person_from_handle(person_handle)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2009-05-19 15:20:40 +05:30
|
|
|
val = self.dnumber[person_handle]
|
2005-12-06 12:08:09 +05:30
|
|
|
self.doc.start_paragraph("DDR-First-Entry","%s." % val)
|
2004-02-22 10:47:14 +05:30
|
|
|
|
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)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
|
|
|
self.doc.start_bold()
|
2009-02-02 18:49:17 +05:30
|
|
|
self.doc.write_text(name, mark)
|
2005-12-06 12:08:09 +05:30
|
|
|
if name[-1:] == '.':
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation("%s " % self.endnotes(person))
|
2005-12-06 12:08:09 +05:30
|
|
|
else:
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation("%s. " % self.endnotes(person))
|
2002-10-20 19:55:16 +05:30
|
|
|
self.doc.end_bold()
|
2009-05-19 15:10:08 +05:30
|
|
|
|
|
|
|
if self.inc_paths:
|
|
|
|
self.write_path(person)
|
2007-07-18 17:26:28 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.dubperson:
|
2002-10-20 19:55:16 +05:30
|
|
|
# Check for duplicate record (result of distant cousins marrying)
|
2009-05-27 02:18:09 +05:30
|
|
|
for dkey in sorted(self.map):
|
2005-12-06 12:08:09 +05:30
|
|
|
if dkey >= key:
|
2004-05-04 06:50:21 +05:30
|
|
|
break
|
|
|
|
if self.map[key] == self.map[dkey]:
|
2010-11-01 20:30:12 +05:30
|
|
|
self.doc.write_text(self._("%(name)s is the same person as [%(id_str)s].") %
|
2005-12-06 12:08:09 +05:30
|
|
|
{ 'name' : '', 'id_str' : str(dkey) })
|
2002-10-20 19:55:16 +05:30
|
|
|
self.doc.end_paragraph()
|
2007-07-18 17:26:28 +05:30
|
|
|
return
|
2007-07-24 17:23:35 +05:30
|
|
|
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
2007-07-18 17:26:28 +05:30
|
|
|
self.write_person_info(person)
|
|
|
|
|
2010-05-26 07:45:38 +05:30
|
|
|
if self.inc_mates or self.listchildren or self.inc_notes \
|
|
|
|
or self.inc_events or self.inc_attrs:
|
2007-07-18 17:26:28 +05:30
|
|
|
for family_handle in person.get_family_handle_list():
|
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_mates:
|
2009-02-02 18:49:17 +05:30
|
|
|
self.__write_mate(person, family)
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.listchildren:
|
2009-02-02 18:49:17 +05:30
|
|
|
self.__write_children(family)
|
2010-05-26 07:45:38 +05:30
|
|
|
if self.inc_notes:
|
|
|
|
self.__write_family_notes(family)
|
|
|
|
first = True
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_events:
|
2010-05-26 07:45:38 +05:30
|
|
|
first = self.__write_family_events(family)
|
|
|
|
if self.inc_attrs:
|
|
|
|
self.__write_family_attrs(family, first)
|
2005-08-18 11:28:28 +05:30
|
|
|
|
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)
|
2010-08-12 11:29:17 +05:30
|
|
|
|
|
|
|
if self.fulldate:
|
2010-11-01 20:30:12 +05:30
|
|
|
date = self.__get_date(event.get_date_object())
|
2010-08-12 11:29:17 +05:30
|
|
|
else:
|
|
|
|
date = event.get_date_object().get_year()
|
|
|
|
|
2006-11-14 10:09:55 +05:30
|
|
|
ph = event.get_place_handle()
|
|
|
|
if ph:
|
|
|
|
place = self.database.get_place_from_handle(ph).get_title()
|
|
|
|
else:
|
|
|
|
place = u''
|
|
|
|
|
|
|
|
self.doc.start_paragraph('DDR-MoreDetails')
|
2009-02-02 18:49:17 +05:30
|
|
|
event_name = str( event.get_type() )
|
2006-11-14 10:09:55 +05:30
|
|
|
if date and place:
|
2010-11-01 20:30:12 +05:30
|
|
|
text += self._('%(date)s, %(place)s') % {
|
2009-01-16 02:39:07 +05:30
|
|
|
'date' : date, 'place' : place }
|
2006-11-14 10:09:55 +05:30
|
|
|
elif date:
|
2010-11-01 20:30:12 +05:30
|
|
|
text += self._('%(date)s') % {'date' : date}
|
2006-11-14 10:09:55 +05:30
|
|
|
elif place:
|
2010-11-01 20:30:12 +05:30
|
|
|
text += self._('%(place)s') % { 'place' : place }
|
2007-06-13 09:43:00 +05:30
|
|
|
|
2006-11-14 10:09:55 +05:30
|
|
|
if event.get_description():
|
2009-01-16 02:39:07 +05:30
|
|
|
if text:
|
2007-06-13 09:43:00 +05:30
|
|
|
text += ". "
|
|
|
|
text += event.get_description()
|
2009-01-16 02:39:07 +05:30
|
|
|
|
|
|
|
text += self.endnotes(event)
|
|
|
|
|
|
|
|
if text:
|
|
|
|
text += ". "
|
|
|
|
|
2010-11-01 20:30:12 +05:30
|
|
|
text = self._('%(event_name)s: %(event_text)s') % {
|
|
|
|
'event_name' : self._(event_name),
|
2009-01-16 02:39:07 +05:30
|
|
|
'event_text' : text }
|
|
|
|
|
2009-03-23 19:22:59 +05:30
|
|
|
self.doc.write_text_citation(text)
|
2009-01-16 02:39:07 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_attrs:
|
2007-07-19 17:39:01 +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-07-19 17:39:01 +05:30
|
|
|
if text:
|
|
|
|
text += "; "
|
2010-11-01 20:30:12 +05:30
|
|
|
attrName = str(attr.get_type())
|
|
|
|
text += self._("%(type)s: %(value)s%(endnotes)s") % {
|
|
|
|
'type' : self._(attrName),
|
2007-07-19 17:39:01 +05:30
|
|
|
'value' : attr.get_value(),
|
|
|
|
'endnotes' : self.endnotes(attr) }
|
2007-11-04 03:38:34 +05:30
|
|
|
text = " " + text
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation(text)
|
2007-11-04 03:38:34 +05:30
|
|
|
|
2006-11-14 10:09:55 +05:30
|
|
|
self.doc.end_paragraph()
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_notes:
|
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)
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_styled_note(note.get_styledtext(),
|
2010-04-17 02:29:10 +05:30
|
|
|
note.get_format(),"DDR-MoreDetails",
|
|
|
|
contains_html= note.get_type() == NoteType.HTML_CODE)
|
2007-11-04 03:38:34 +05:30
|
|
|
|
2009-11-03 10:55:15 +05:30
|
|
|
def __write_parents(self, person):
|
2005-02-02 10:39:07 +05:30
|
|
|
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)
|
2002-10-20 19:55:16 +05:30
|
|
|
else:
|
2005-02-02 10:39:07 +05:30
|
|
|
mother_name = ""
|
2006-06-03 09:02:26 +05:30
|
|
|
mother_mark = ""
|
2005-02-02 10:39:07 +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)
|
2004-05-04 06:50:21 +05:30
|
|
|
else:
|
2005-02-02 10:39:07 +05:30
|
|
|
father_name = ""
|
2006-06-03 09:02:26 +05:30
|
|
|
father_mark = ""
|
2009-11-03 10:55:15 +05:30
|
|
|
text = self.__narrator.get_child_string(father_name, mother_name)
|
2005-02-02 10:39:07 +05:30
|
|
|
if text:
|
|
|
|
self.doc.write_text(text)
|
2006-06-03 09:02:26 +05:30
|
|
|
if father_mark:
|
2009-02-02 18:49:17 +05:30
|
|
|
self.doc.write_text("", father_mark)
|
2006-06-03 09:02:26 +05:30
|
|
|
if mother_mark:
|
2009-02-02 18:49:17 +05:30
|
|
|
self.doc.write_text("", mother_mark)
|
2005-02-02 10:39:07 +05:30
|
|
|
|
|
|
|
def write_marriage(self, person):
|
2005-12-06 12:08:09 +05:30
|
|
|
"""
|
|
|
|
Output marriage sentence.
|
|
|
|
"""
|
2005-02-02 10:39:07 +05:30
|
|
|
is_first = True
|
|
|
|
for family_handle in person.get_family_handle_list():
|
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
2009-02-02 18:49:17 +05:30
|
|
|
spouse_handle = ReportUtils.find_spouse(person, family)
|
2005-02-02 10:39:07 +05:30
|
|
|
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
|
|
|
|
2009-11-03 10:55:15 +05:30
|
|
|
text = self.__narrator.get_married_string(family, is_first)
|
2007-08-20 07:58:41 +05:30
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
if text:
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation(text, spouse_mark)
|
2005-02-02 10:39:07 +05:30
|
|
|
is_first = False
|
2009-02-02 18:49:17 +05:30
|
|
|
|
|
|
|
def __write_mate(self, person, family):
|
2002-10-20 19:55:16 +05:30
|
|
|
"""
|
2009-02-02 18:49:17 +05:30
|
|
|
Write information about the person's spouse/mate.
|
|
|
|
"""
|
2009-08-14 12:44:25 +05:30
|
|
|
if person.get_gender() == Person.MALE:
|
2009-02-02 18:49:17 +05:30
|
|
|
mate_handle = family.get_mother_handle()
|
|
|
|
else:
|
|
|
|
mate_handle = family.get_father_handle()
|
|
|
|
|
|
|
|
if mate_handle:
|
|
|
|
mate = self.database.get_person_from_handle(mate_handle)
|
|
|
|
|
|
|
|
self.doc.start_paragraph("DDR-MoreHeader")
|
|
|
|
name = _nd.display_formal(mate)
|
|
|
|
mark = ReportUtils.get_person_mark(self.database, mate)
|
2009-08-14 12:44:25 +05:30
|
|
|
if family.get_relationship() == FamilyRelType.MARRIED:
|
2010-11-01 20:30:12 +05:30
|
|
|
self.doc.write_text(self._("Spouse: %s") % name, mark)
|
2009-02-02 18:49:17 +05:30
|
|
|
else:
|
2010-11-01 20:30:12 +05:30
|
|
|
self.doc.write_text(self._("Relationship with: %s") % name, mark)
|
2009-02-02 18:49:17 +05:30
|
|
|
if name[-1:] != '.':
|
|
|
|
self.doc.write_text(".")
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation(self.endnotes(mate))
|
2009-02-02 18:49:17 +05:30
|
|
|
self.doc.end_paragraph()
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
self.write_person_info(mate)
|
|
|
|
|
2010-05-26 07:45:38 +05:30
|
|
|
def __get_mate_names(self, family):
|
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:
|
2010-11-01 20:30:12 +05:30
|
|
|
mother_name = self._("unknown")
|
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:
|
2010-11-01 20:30:12 +05:30
|
|
|
father_name = self._("unknown")
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2010-05-26 07:45:38 +05:30
|
|
|
return mother_name, father_name
|
|
|
|
|
|
|
|
def __write_children(self, family):
|
|
|
|
"""
|
|
|
|
List the children for the given family.
|
|
|
|
"""
|
|
|
|
if not family.get_child_ref_list():
|
|
|
|
return
|
|
|
|
|
|
|
|
mother_name, father_name = self.__get_mate_names(family)
|
|
|
|
|
2005-02-02 10:39:07 +05:30
|
|
|
self.doc.start_paragraph("DDR-ChildTitle")
|
2007-12-24 03:04:36 +05:30
|
|
|
self.doc.write_text(
|
2010-11-01 20:30:12 +05:30
|
|
|
self._("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()
|
2002-10-20 19:55:16 +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)
|
2009-02-02 18:49:17 +05:30
|
|
|
child_mark = ReportUtils.get_person_mark(self.database, child)
|
2005-02-02 10:39:07 +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
|
|
|
|
2010-02-14 07:07:55 +05:30
|
|
|
if self.inc_ssign:
|
|
|
|
prefix = " "
|
|
|
|
for family_handle in child.get_family_handle_list():
|
|
|
|
family = self.database.get_family_from_handle(family_handle)
|
|
|
|
if family.get_child_ref_list():
|
|
|
|
prefix = "+ "
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
prefix = ""
|
|
|
|
|
2009-10-18 06:58:49 +05:30
|
|
|
if child_handle in self.dnumber:
|
|
|
|
self.doc.start_paragraph("DDR-ChildList",
|
2010-02-14 07:07:55 +05:30
|
|
|
prefix
|
|
|
|
+ str(self.dnumber[child_handle])
|
2009-10-18 06:58:49 +05:30
|
|
|
+ " "
|
|
|
|
+ ReportUtils.roman(cnt).lower()
|
|
|
|
+ ".")
|
|
|
|
else:
|
|
|
|
self.doc.start_paragraph("DDR-ChildList",
|
2010-02-14 07:07:55 +05:30
|
|
|
prefix + ReportUtils.roman(cnt).lower() + ".")
|
2005-12-06 12:08:09 +05:30
|
|
|
cnt += 1
|
2005-02-02 10:39:07 +05:30
|
|
|
|
2009-10-18 06:58:49 +05:30
|
|
|
self.doc.write_text("%s. " % child_name, child_mark)
|
2009-11-03 10:55:15 +05:30
|
|
|
self.__narrator.set_subject(child)
|
2009-12-24 01:46:16 +05:30
|
|
|
self.doc.write_text_citation(self.__narrator.get_born_string() or
|
|
|
|
self.__narrator.get_christened_string() or
|
|
|
|
self.__narrator.get_baptised_string())
|
|
|
|
self.doc.write_text_citation(self.__narrator.get_died_string() or
|
|
|
|
self.__narrator.get_buried_string())
|
2005-02-02 10:39:07 +05:30
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
2010-05-26 07:45:38 +05:30
|
|
|
def __write_family_notes(self, family):
|
|
|
|
"""
|
|
|
|
Write the notes for the given family.
|
|
|
|
"""
|
|
|
|
notelist = family.get_note_list()
|
|
|
|
if len(notelist) > 0:
|
|
|
|
mother_name, father_name = self.__get_mate_names(family)
|
|
|
|
|
|
|
|
self.doc.start_paragraph("DDR-NoteHeader")
|
|
|
|
self.doc.write_text(
|
2010-11-01 20:30:12 +05:30
|
|
|
self._('Notes for %(mother_name)s and %(father_name)s:') % {
|
2010-05-26 07:45:38 +05:30
|
|
|
'mother_name' : mother_name,
|
|
|
|
'father_name' : father_name })
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
for notehandle in notelist:
|
|
|
|
note = self.database.get_note_from_handle(notehandle)
|
|
|
|
self.doc.write_styled_note(note.get_styledtext(),
|
|
|
|
note.get_format(),"DDR-Entry")
|
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
def __write_family_events(self, family):
|
|
|
|
"""
|
|
|
|
List the events for the given family.
|
|
|
|
"""
|
2006-11-14 10:09:55 +05:30
|
|
|
if not family.get_event_ref_list():
|
|
|
|
return
|
|
|
|
|
2010-05-26 07:45:38 +05:30
|
|
|
mother_name, father_name = self.__get_mate_names(family)
|
2006-11-14 10:09:55 +05:30
|
|
|
|
|
|
|
first = 1
|
|
|
|
for event_ref in family.get_event_ref_list():
|
|
|
|
if first:
|
|
|
|
self.doc.start_paragraph('DDR-MoreHeader')
|
|
|
|
self.doc.write_text(
|
2010-11-01 20:30:12 +05:30
|
|
|
self._('More about %(mother_name)s and %(father_name)s:') % {
|
2006-11-14 10:09:55 +05:30
|
|
|
'mother_name' : mother_name,
|
|
|
|
'father_name' : father_name })
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
first = 0
|
|
|
|
self.write_event(event_ref)
|
2010-05-26 07:45:38 +05:30
|
|
|
return first
|
|
|
|
|
|
|
|
def __write_family_attrs(self, family, first):
|
|
|
|
"""
|
|
|
|
List the attributes for the given family.
|
|
|
|
"""
|
|
|
|
attrs = family.get_attribute_list()
|
|
|
|
|
|
|
|
if first and attrs:
|
|
|
|
mother_name, father_name = self.__get_mate_names(family)
|
|
|
|
|
|
|
|
self.doc.start_paragraph('DDR-MoreHeader')
|
|
|
|
self.doc.write_text(
|
2010-11-01 20:30:12 +05:30
|
|
|
self._('More about %(mother_name)s and %(father_name)s:') % {
|
2010-05-26 07:45:38 +05:30
|
|
|
'mother_name' : mother_name,
|
|
|
|
'father_name' : father_name })
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
|
|
|
for attr in attrs:
|
|
|
|
self.doc.start_paragraph('DDR-MoreDetails')
|
2010-11-01 21:03:53 +05:30
|
|
|
attrName = str(attr.get_type())
|
2010-11-01 20:30:12 +05:30
|
|
|
text = self._("%(type)s: %(value)s%(endnotes)s") % {
|
2010-11-01 21:03:53 +05:30
|
|
|
'type' : self._(attrName),
|
2010-05-26 07:45:38 +05:30
|
|
|
'value' : attr.get_value(),
|
|
|
|
'endnotes' : self.endnotes(attr) }
|
|
|
|
self.doc.write_text_citation( text )
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
|
|
|
if self.inc_notes:
|
|
|
|
# if the attr or attr reference has a note attached to it,
|
|
|
|
# get the text and format it correctly
|
|
|
|
notelist = attr.get_note_list()
|
|
|
|
for notehandle in notelist:
|
|
|
|
note = self.database.get_note_from_handle(notehandle)
|
|
|
|
self.doc.write_styled_note(note.get_styledtext(),
|
|
|
|
note.get_format(),"DDR-MoreDetails")
|
|
|
|
|
2006-11-14 10:09:55 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
def write_person_info(self, person):
|
2007-07-18 17:26:28 +05:30
|
|
|
name = _nd.display_formal(person)
|
2009-11-03 10:55:15 +05:30
|
|
|
self.__narrator.set_subject(person)
|
2007-07-18 17:26:28 +05:30
|
|
|
|
|
|
|
plist = person.get_media_list()
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.addimages and len(plist) > 0:
|
2007-07-18 17:26:28 +05:30
|
|
|
photo = plist[0]
|
2009-02-02 18:49:17 +05:30
|
|
|
ReportUtils.insert_image(self.database, self.doc, photo)
|
2007-07-18 17:26:28 +05:30
|
|
|
|
|
|
|
self.doc.start_paragraph("DDR-Entry")
|
2008-01-06 11:43:37 +05:30
|
|
|
|
|
|
|
if not self.verbose:
|
2009-11-03 10:55:15 +05:30
|
|
|
self.__write_parents(person)
|
2008-01-06 11:43:37 +05:30
|
|
|
|
2009-11-03 10:55:15 +05:30
|
|
|
text = self.__narrator.get_born_string()
|
2007-07-18 17:26:28 +05:30
|
|
|
if text:
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation(text)
|
2008-07-22 14:40:53 +05:30
|
|
|
|
2009-12-24 01:46:16 +05:30
|
|
|
text = self.__narrator.get_baptised_string()
|
2008-07-22 14:40:53 +05:30
|
|
|
if text:
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation(text)
|
2009-01-16 03:10:25 +05:30
|
|
|
|
2009-11-03 10:55:15 +05:30
|
|
|
text = self.__narrator.get_christened_string()
|
2009-01-16 03:10:25 +05:30
|
|
|
if text:
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation(text)
|
2007-07-18 17:26:28 +05:30
|
|
|
|
2009-11-03 10:55:15 +05:30
|
|
|
text = self.__narrator.get_died_string(self.calcageflag)
|
2007-07-18 17:26:28 +05:30
|
|
|
if text:
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation(text)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2009-11-03 10:55:15 +05:30
|
|
|
text = self.__narrator.get_buried_string()
|
2007-07-18 17:26:28 +05:30
|
|
|
if text:
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation(text)
|
2007-07-18 17:26:28 +05:30
|
|
|
|
2008-01-06 11:43:37 +05:30
|
|
|
if self.verbose:
|
2009-11-03 10:55:15 +05:30
|
|
|
self.__write_parents(person)
|
2007-07-18 17:26:28 +05:30
|
|
|
self.write_marriage(person)
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
|
|
|
notelist = person.get_note_list()
|
2008-01-23 11:11:46 +05:30
|
|
|
if len(notelist) > 0 and self.inc_notes:
|
2007-07-18 17:26:28 +05:30
|
|
|
self.doc.start_paragraph("DDR-NoteHeader")
|
2010-11-01 20:30:12 +05:30
|
|
|
self.doc.write_text(self._("Notes for %s") % name)
|
2007-07-18 17:26:28 +05:30
|
|
|
self.doc.end_paragraph()
|
|
|
|
for notehandle in notelist:
|
|
|
|
note = self.database.get_note_from_handle(notehandle)
|
2009-02-08 16:57:56 +05:30
|
|
|
self.doc.write_styled_note(note.get_styledtext(),
|
2010-04-17 02:29:10 +05:30
|
|
|
note.get_format(),"DDR-Entry",
|
|
|
|
contains_html= note.get_type() == NoteType.HTML_CODE)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2007-07-18 17:26:28 +05:30
|
|
|
first = True
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_names:
|
2007-07-18 17:26:28 +05:30
|
|
|
for alt_name in person.get_alternate_names():
|
|
|
|
if first:
|
|
|
|
self.doc.start_paragraph('DDR-MoreHeader')
|
2010-11-01 20:30:12 +05:30
|
|
|
self.doc.write_text(self._('More about %(person_name)s:') % {
|
2007-07-18 17:26:28 +05:30
|
|
|
'person_name' : name })
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
first = False
|
|
|
|
self.doc.start_paragraph('DDR-MoreDetails')
|
|
|
|
atype = str( alt_name.get_type() )
|
|
|
|
aname = alt_name.get_regular_name()
|
2010-11-01 20:30:12 +05:30
|
|
|
self.doc.write_text_citation(self._('%(name_kind)s: %(name)s%(endnotes)s') % {
|
2007-07-18 17:26:28 +05:30
|
|
|
'name_kind' : atype,
|
|
|
|
'name' : aname,
|
|
|
|
'endnotes' : self.endnotes(alt_name),
|
|
|
|
})
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_events:
|
2007-07-18 17:26:28 +05:30
|
|
|
for event_ref in person.get_primary_event_ref_list():
|
|
|
|
if first:
|
|
|
|
self.doc.start_paragraph('DDR-MoreHeader')
|
2010-11-01 20:30:12 +05:30
|
|
|
self.doc.write_text(self._('More about %(person_name)s:') % {
|
2007-07-18 17:26:28 +05:30
|
|
|
'person_name' : _nd.display(person) })
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
first = 0
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2007-07-18 17:26:28 +05:30
|
|
|
self.write_event(event_ref)
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_addr:
|
2007-07-18 17:26:28 +05:30
|
|
|
for addr in person.get_address_list():
|
|
|
|
if first:
|
|
|
|
self.doc.start_paragraph('DDR-MoreHeader')
|
2010-11-01 20:30:12 +05:30
|
|
|
self.doc.write_text(self._('More about %(person_name)s:') % {
|
2007-07-18 17:26:28 +05:30
|
|
|
'person_name' : name })
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
first = False
|
|
|
|
self.doc.start_paragraph('DDR-MoreDetails')
|
|
|
|
|
|
|
|
text = ReportUtils.get_address_str(addr)
|
2010-08-12 11:29:17 +05:30
|
|
|
|
|
|
|
if self.fulldate:
|
2010-11-01 20:30:12 +05:30
|
|
|
date = self.__get_date(addr.get_date_object())
|
2010-08-12 11:29:17 +05:30
|
|
|
else:
|
|
|
|
date = addr.get_date_object().get_year()
|
|
|
|
|
2010-11-01 20:30:12 +05:30
|
|
|
self.doc.write_text(self._('Address: '))
|
2007-07-18 17:26:28 +05:30
|
|
|
if date:
|
|
|
|
self.doc.write_text( '%s, ' % date )
|
|
|
|
self.doc.write_text( text )
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation( self.endnotes(addr) )
|
2005-02-02 10:39:07 +05:30
|
|
|
self.doc.end_paragraph()
|
2007-07-19 17:39:01 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_attrs:
|
2007-07-19 17:39:01 +05:30
|
|
|
attrs = person.get_attribute_list()
|
|
|
|
if first and attrs:
|
|
|
|
self.doc.start_paragraph('DDR-MoreHeader')
|
2010-11-01 20:30:12 +05:30
|
|
|
self.doc.write_text(self._('More about %(person_name)s:') % {
|
2007-07-19 17:39:01 +05:30
|
|
|
'person_name' : name })
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
first = False
|
|
|
|
|
|
|
|
for attr in attrs:
|
|
|
|
self.doc.start_paragraph('DDR-MoreDetails')
|
2010-11-01 20:30:12 +05:30
|
|
|
text = self._("%(type)s: %(value)s%(endnotes)s") % {
|
2007-07-19 17:39:01 +05:30
|
|
|
'type' : attr.get_type(),
|
|
|
|
'value' : attr.get_value(),
|
|
|
|
'endnotes' : self.endnotes(attr) }
|
2009-02-11 04:37:35 +05:30
|
|
|
self.doc.write_text_citation( text )
|
2007-07-19 17:39:01 +05:30
|
|
|
self.doc.end_paragraph()
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def endnotes(self, obj):
|
|
|
|
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
|
|
|
|
2010-05-01 09:42:42 +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 22:05:32 +05:30
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
2007-12-28 10:42:30 +05:30
|
|
|
# DetDescendantOptions
|
2003-07-07 22:05:32 +05:30
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2007-12-28 10:42:30 +05:30
|
|
|
class DetDescendantOptions(MenuReportOptions):
|
2005-01-02 01:28:53 +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):
|
2008-01-06 02:12:05 +05:30
|
|
|
"""
|
|
|
|
Add options to the menu for the detailed descendant report.
|
|
|
|
"""
|
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)
|
|
|
|
|
2009-10-18 06:58:49 +05:30
|
|
|
numbering = EnumeratedListOption(_("Numbering system"), "Henry")
|
|
|
|
numbering.set_items([
|
|
|
|
("Henry", _("Henry numbering")),
|
|
|
|
("d'Aboville", _("d'Aboville numbering")),
|
|
|
|
("Record (Modified Register)",
|
|
|
|
_("Record (Modified Register) numbering"))])
|
|
|
|
numbering.set_help(_("The numbering system to be used"))
|
|
|
|
menu.add_option(category_name, "numbering", numbering)
|
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
generations = NumberOption(_("Generations"), 10, 1, 100)
|
|
|
|
generations.set_help(_("The number of generations to include in the " \
|
|
|
|
"report"))
|
|
|
|
menu.add_option(category_name, "gen", generations)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
pagebbg = BooleanOption(_("Page break between generations"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
pagebbg.set_help(
|
|
|
|
_("Whether to start a new page after each generation."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "pagebbg", pagebbg)
|
|
|
|
|
2010-05-26 02:51:52 +05:30
|
|
|
pageben = BooleanOption(_("Page break before end notes"),False)
|
|
|
|
pageben.set_help(
|
|
|
|
_("Whether to start a new page before the end notes."))
|
|
|
|
menu.add_option(category_name,"pageben",pageben)
|
|
|
|
|
2010-11-01 20:30:12 +05:30
|
|
|
trans = EnumeratedListOption(_("Translation"),
|
|
|
|
Translator.DEFAULT_TRANSLATION_STR)
|
|
|
|
trans.add_item(Translator.DEFAULT_TRANSLATION_STR, _("default"))
|
|
|
|
for language in TransUtils.get_available_translations():
|
|
|
|
trans.add_item(language, get_language_string(language))
|
|
|
|
trans.set_help(_("The translation to be used for the report."))
|
|
|
|
menu.add_option(category_name, "trans", trans)
|
|
|
|
|
2007-12-28 10:42:30 +05:30
|
|
|
category_name = _("Content")
|
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
usecall = BooleanOption(_("Use callname for common name"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
usecall.set_help(_("Whether to use the call name as the first name."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "usecall", usecall)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
fulldates = BooleanOption(_("Use full dates instead of only the year"),
|
|
|
|
True)
|
2007-12-28 10:42:30 +05:30
|
|
|
fulldates.set_help(_("Whether to use full dates instead of just year."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "fulldates", fulldates)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
listc = BooleanOption(_("List children"), True)
|
2007-12-28 10:42:30 +05:30
|
|
|
listc.set_help(_("Whether to list children."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "listc", listc)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-11-03 10:55:15 +05:30
|
|
|
computeage = BooleanOption(_("Compute death age"),True)
|
|
|
|
computeage.set_help(_("Whether to compute a person's age at death."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "computeage", computeage)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
omitda = BooleanOption(_("Omit duplicate ancestors"), True)
|
2007-12-28 10:42:30 +05:30
|
|
|
omitda.set_help(_("Whether to omit duplicate ancestors."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "omitda", omitda)
|
2008-01-06 11:43:37 +05:30
|
|
|
|
2009-10-18 06:58:49 +05:30
|
|
|
verbose = BooleanOption(_("Use complete sentences"), True)
|
2008-01-06 11:43:37 +05:30
|
|
|
verbose.set_help(
|
|
|
|
_("Whether to use complete sentences or succinct language."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "verbose", verbose)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
desref = BooleanOption(_("Add descendant reference in child list"),
|
|
|
|
True)
|
2007-12-28 10:42:30 +05:30
|
|
|
desref.set_help(
|
|
|
|
_("Whether to add descendant references in child list."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "desref", desref)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
|
|
|
category_name = _("Include")
|
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
incnotes = BooleanOption(_("Include notes"), True)
|
2007-12-28 10:42:30 +05:30
|
|
|
incnotes.set_help(_("Whether to include notes."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "incnotes", incnotes)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
incattrs = BooleanOption(_("Include attributes"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
incattrs.set_help(_("Whether to include attributes."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "incattrs", incattrs)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
incphotos = BooleanOption(_("Include Photo/Images from Gallery"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
incphotos.set_help(_("Whether to include images."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "incphotos", incphotos)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
incnames = BooleanOption(_("Include alternative names"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
incnames.set_help(_("Whether to include other names."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "incnames", incnames)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
incevents = BooleanOption(_("Include events"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
incevents.set_help(_("Whether to include events."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "incevents", incevents)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
incaddresses = BooleanOption(_("Include addresses"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
incaddresses.set_help(_("Whether to include addresses."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "incaddresses", incaddresses)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
incsources = BooleanOption(_("Include sources"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
incsources.set_help(_("Whether to include source references."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "incsources", incsources)
|
2009-08-14 16:58:28 +05:30
|
|
|
|
|
|
|
incsrcnotes = BooleanOption(_("Include sources notes"), False)
|
|
|
|
incsrcnotes.set_help(_("Whether to include source notes in the "
|
|
|
|
"Endnotes section. Only works if Include sources is selected."))
|
|
|
|
menu.add_option(category_name, "incsrcnotes", incsrcnotes)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
incmates = BooleanOption(_("Include spouses"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
incmates.set_help(_("Whether to include detailed spouse information."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "incmates", incmates)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2010-02-14 07:07:55 +05:30
|
|
|
incssign = BooleanOption(_("Include sign of succession ('+')" \
|
|
|
|
" in child-list"), True)
|
|
|
|
incssign.set_help(_("Whether to include a sign ('+') before the"
|
|
|
|
" descendant number in the child-list to indicate"
|
|
|
|
" a child has succession."))
|
|
|
|
menu.add_option(category_name, "incssign", incssign)
|
|
|
|
|
2009-05-19 15:10:08 +05:30
|
|
|
incpaths = BooleanOption(_("Include path to start-person"), False)
|
|
|
|
incpaths.set_help(_("Whether to include the path of descendancy " \
|
2010-02-14 07:07:55 +05:30
|
|
|
"from the start-person to each descendant."))
|
2009-05-19 15:10:08 +05:30
|
|
|
menu.add_option(category_name, "incpaths", incpaths)
|
|
|
|
|
2007-12-28 10:42:30 +05:30
|
|
|
category_name = _("Missing information")
|
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
repplace = BooleanOption(_("Replace missing places with ______"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
repplace.set_help(_("Whether to replace missing Places with blanks."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "repplace", repplace)
|
2007-12-28 10:42:30 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
repdate = BooleanOption(_("Replace missing dates with ______"), False)
|
2007-12-28 10:42:30 +05:30
|
|
|
repdate.set_help(_("Whether to replace missing Dates with blanks."))
|
2009-02-02 18:49:17 +05:30
|
|
|
menu.add_option(category_name, "repdate", repdate)
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2009-02-02 18:49:17 +05:30
|
|
|
def make_default_style(self, default_style):
|
2005-12-06 12:08:09 +05:30
|
|
|
"""Make the default output style for the Detailed Ancestral Report"""
|
2009-05-30 03:55:44 +05:30
|
|
|
font = FontStyle()
|
|
|
|
font.set(face=FONT_SANS_SERIF, size=16, bold=1)
|
|
|
|
para = ParagraphStyle()
|
2005-01-02 01:28:53 +05:30
|
|
|
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)
|
2009-05-30 03:55:44 +05:30
|
|
|
para.set_alignment(PARA_ALIGN_CENTER)
|
2005-01-02 01:28:53 +05:30
|
|
|
para.set_description(_('The style used for the title of the page.'))
|
2009-02-02 18:49:17 +05:30
|
|
|
default_style.add_paragraph_style("DDR-Title", para)
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2009-05-30 03:55:44 +05:30
|
|
|
font = FontStyle()
|
|
|
|
font.set(face=FONT_SANS_SERIF, size=14, italic=1)
|
|
|
|
para = ParagraphStyle()
|
2005-01-02 01:28:53 +05:30
|
|
|
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-02 01:28:53 +05:30
|
|
|
para.set_description(_('The style used for the generation header.'))
|
2009-02-02 18:49:17 +05:30
|
|
|
default_style.add_paragraph_style("DDR-Generation", para)
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2009-05-30 03:55:44 +05:30
|
|
|
font = FontStyle()
|
|
|
|
font.set(face=FONT_SANS_SERIF, size=10, italic=0, bold=1)
|
|
|
|
para = ParagraphStyle()
|
2005-01-02 01:28:53 +05:30
|
|
|
para.set_font(font)
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set_left_margin(1.5) # in centimeters
|
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2005-01-02 01:28:53 +05:30
|
|
|
para.set_description(_('The style used for the children list title.'))
|
2009-02-02 18:49:17 +05:30
|
|
|
default_style.add_paragraph_style("DDR-ChildTitle", para)
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2009-05-30 03:55:44 +05:30
|
|
|
font = FontStyle()
|
2005-12-06 12:08:09 +05:30
|
|
|
font.set(size=10)
|
2009-05-30 03:55:44 +05:30
|
|
|
para = ParagraphStyle()
|
2005-01-02 01:28:53 +05:30
|
|
|
para.set_font(font)
|
2009-02-02 18:49:17 +05:30
|
|
|
para.set(first_indent=-0.75, lmargin=2.25)
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set_top_margin(0.125)
|
|
|
|
para.set_bottom_margin(0.125)
|
2005-01-02 01:28:53 +05:30
|
|
|
para.set_description(_('The style used for the children list.'))
|
2009-02-02 18:49:17 +05:30
|
|
|
default_style.add_paragraph_style("DDR-ChildList", para)
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2009-05-30 03:55:44 +05:30
|
|
|
font = FontStyle()
|
|
|
|
font.set(face=FONT_SANS_SERIF, size=10, italic=0, bold=1)
|
|
|
|
para = ParagraphStyle()
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set_font(font)
|
2009-02-02 18:49:17 +05:30
|
|
|
para.set(first_indent=0.0, lmargin=1.5)
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2009-02-02 18:49:17 +05:30
|
|
|
default_style.add_paragraph_style("DDR-NoteHeader", para)
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2009-05-30 03:55:44 +05:30
|
|
|
para = ParagraphStyle()
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set(lmargin=1.5)
|
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
|
|
|
para.set_description(_('The basic style used for the text display.'))
|
2009-02-02 18:49:17 +05:30
|
|
|
default_style.add_paragraph_style("DDR-Entry", para)
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2009-05-30 03:55:44 +05:30
|
|
|
para = ParagraphStyle()
|
2009-02-02 18:49:17 +05:30
|
|
|
para.set(first_indent=-1.5, lmargin=1.5)
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2005-01-02 01:28:53 +05:30
|
|
|
para.set_description(_('The style used for the first personal entry.'))
|
2009-02-02 18:49:17 +05:30
|
|
|
default_style.add_paragraph_style("DDR-First-Entry", para)
|
2005-01-02 01:28:53 +05:30
|
|
|
|
2009-05-30 03:55:44 +05:30
|
|
|
font = FontStyle()
|
|
|
|
font.set(size=10, face=FONT_SANS_SERIF, bold=1)
|
|
|
|
para = ParagraphStyle()
|
2005-08-18 11:28:28 +05:30
|
|
|
para.set_font(font)
|
2009-02-02 18:49:17 +05:30
|
|
|
para.set(first_indent=0.0, lmargin=1.5)
|
2005-12-06 12:08:09 +05:30
|
|
|
para.set_top_margin(0.25)
|
|
|
|
para.set_bottom_margin(0.25)
|
2010-05-26 07:45:38 +05:30
|
|
|
para.set_description(_('The style used for the More About header and '
|
|
|
|
'for headers of mates.'))
|
2009-02-02 18:49:17 +05:30
|
|
|
default_style.add_paragraph_style("DDR-MoreHeader", para)
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2009-05-30 03:55:44 +05:30
|
|
|
font = FontStyle()
|
|
|
|
font.set(face=FONT_SERIF, size=10)
|
|
|
|
para = ParagraphStyle()
|
2005-08-18 11:28:28 +05:30
|
|
|
para.set_font(font)
|
2009-02-02 18:49:17 +05:30
|
|
|
para.set(first_indent=0.0, lmargin=1.5)
|
2005-12-06 12:08:09 +05:30
|
|
|
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.'))
|
2009-02-02 18:49:17 +05:30
|
|
|
default_style.add_paragraph_style("DDR-MoreDetails", para)
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2010-05-01 09:42:42 +05:30
|
|
|
endnotes.add_endnote_styles(default_style)
|