2007-08-19 01:39:45 +05:30
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
2008-01-06 02:12:05 +05:30
|
|
|
# Copyright (C) 2007-2008 Brian G. Matherly
|
2009-04-10 21:50:41 +05:30
|
|
|
# Copyright (C) 2009 Gary Burton
|
2007-08-19 01:39:45 +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
|
|
|
|
#
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
2008-03-02 04:17:48 +05:30
|
|
|
"""Reports/Text Reports/Kinship Report"""
|
2007-08-19 01:39:45 +05:30
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# python modules
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
from gettext import gettext as _
|
|
|
|
from string import capitalize
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# gramps modules
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2008-10-02 09:32:10 +05:30
|
|
|
from gen.plug import PluginManager
|
2008-09-27 19:26:17 +05:30
|
|
|
from gen.plug.menu import NumberOption, BooleanOption, PersonOption
|
2008-10-02 09:32:10 +05:30
|
|
|
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_TEXT
|
2009-05-31 20:29:56 +05:30
|
|
|
from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
|
|
|
FONT_SANS_SERIF, INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
|
2007-08-19 01:39:45 +05:30
|
|
|
from BasicUtils import name_displayer
|
|
|
|
import DateHandler
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# KinshipReport
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
class KinshipReport(Report):
|
|
|
|
|
2008-02-20 10:22:10 +05:30
|
|
|
def __init__(self, database, options_class):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
2008-02-24 19:25:55 +05:30
|
|
|
Create the KinshipReport object that produces the report.
|
2007-08-19 01:39:45 +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.
|
|
|
|
|
|
|
|
maxdescend - Maximum generations of descendants to include.
|
|
|
|
maxascend - Maximum generations of ancestors to include.
|
|
|
|
incspouses - Whether to include spouses.
|
|
|
|
inccousins - Whether to include cousins.
|
2007-08-19 07:21:26 +05:30
|
|
|
incaunts - Whether to include aunts/uncles/nephews/nieces.
|
2008-01-06 02:12:05 +05:30
|
|
|
pid - The Gramps ID of the center person for the report.
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
2008-02-20 10:22:10 +05:30
|
|
|
Report.__init__(self, database, options_class)
|
2007-08-19 01:39:45 +05:30
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
menu = options_class.menu
|
|
|
|
self.max_descend = menu.get_option_by_name('maxdescend').get_value()
|
|
|
|
self.max_ascend = menu.get_option_by_name('maxascend').get_value()
|
|
|
|
self.inc_spouses = menu.get_option_by_name('incspouses').get_value()
|
|
|
|
self.inc_cousins = menu.get_option_by_name('inccousins').get_value()
|
|
|
|
self.inc_aunts = menu.get_option_by_name('incaunts').get_value()
|
|
|
|
pid = menu.get_option_by_name('pid').get_value()
|
2008-01-06 02:12:05 +05:30
|
|
|
self.person = database.get_person_from_gramps_id(pid)
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
self.__db = database
|
2008-05-19 00:54:28 +05:30
|
|
|
pmgr = PluginManager.get_instance()
|
|
|
|
self.rel_calc = pmgr.get_relationship_calculator()
|
|
|
|
|
2007-08-19 01:39:45 +05:30
|
|
|
self.kinship_map = {}
|
|
|
|
self.spouse_map = {}
|
|
|
|
|
|
|
|
def write_report(self):
|
|
|
|
"""
|
|
|
|
The routine the actually creates the report. At this point, the document
|
|
|
|
is opened and ready for writing.
|
|
|
|
"""
|
|
|
|
pname = name_displayer.display(self.person)
|
|
|
|
|
|
|
|
self.doc.start_paragraph("KIN-Title")
|
|
|
|
title = _("Kinship Report for %s") % pname
|
2009-05-30 03:55:44 +05:30
|
|
|
mark = IndexMark(title, INDEX_TYPE_TOC, 1)
|
2008-01-23 11:11:46 +05:30
|
|
|
self.doc.write_text(title, mark)
|
2007-08-19 01:39:45 +05:30
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_spouses:
|
2007-08-19 01:39:45 +05:30
|
|
|
spouse_handles = self.get_spouse_handles(self.person.get_handle())
|
|
|
|
if spouse_handles:
|
2008-01-23 11:11:46 +05:30
|
|
|
self.write_people(_("Spouses"), spouse_handles)
|
2007-08-19 01:39:45 +05:30
|
|
|
|
|
|
|
# Collect all descendants of the person
|
2008-01-23 11:11:46 +05:30
|
|
|
self.traverse_down(self.person.get_handle(), 0, 1)
|
2007-08-19 01:39:45 +05:30
|
|
|
|
2007-08-19 07:21:26 +05:30
|
|
|
# Collect all ancestors/aunts/uncles/nephews/cousins of the person
|
2008-01-23 11:11:46 +05:30
|
|
|
self.traverse_up(self.person.get_handle(), 1, 0)
|
2007-08-19 01:39:45 +05:30
|
|
|
|
2008-01-06 02:12:05 +05:30
|
|
|
# Write Kin
|
2009-05-27 02:18:09 +05:30
|
|
|
for Ga, Gbs in self.kinship_map.iteritems():
|
|
|
|
for Gb in Gbs:
|
2007-08-19 01:39:45 +05:30
|
|
|
# To understand these calculations, see:
|
|
|
|
# http://en.wikipedia.org/wiki/Cousin#Mathematical_definitions
|
|
|
|
x = min (Ga,Gb)
|
|
|
|
y = abs(Ga-Gb)
|
|
|
|
# Skip unrequested people
|
2008-01-23 11:11:46 +05:30
|
|
|
if x == 1 and y > 0 and not self.inc_aunts:
|
2007-08-19 01:39:45 +05:30
|
|
|
continue
|
2008-01-23 11:11:46 +05:30
|
|
|
elif x > 1 and not self.inc_cousins:
|
2007-08-19 01:39:45 +05:30
|
|
|
continue
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
title = self.rel_calc.get_plural_relationship_string(Ga,Gb)
|
2007-08-19 01:39:45 +05:30
|
|
|
self.write_people(title,self.kinship_map[Ga][Gb])
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_spouses and \
|
2008-07-17 23:40:32 +05:30
|
|
|
Ga in self.spouse_map and \
|
|
|
|
Gb in self.spouse_map[Ga]:
|
2007-08-19 01:39:45 +05:30
|
|
|
title = _("spouses of %s") % title
|
|
|
|
self.write_people(title,self.spouse_map[Ga][Gb])
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def traverse_down(self, person_handle, Ga, Gb, skip_handle=None):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
|
|
|
Populate a map of arrays containing person handles for the descendants
|
|
|
|
of the passed person. This function calls itself recursively until it
|
|
|
|
reaches max_descend.
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
person_handle: the handle of the person to go to next
|
|
|
|
Ga: The number of generations from the main person to the common
|
|
|
|
ancestor. This should be incremented when going up generations, and
|
|
|
|
left alone when going down generations.
|
|
|
|
Gb: The number of generations from this person (person_handle) to the
|
|
|
|
common ancestor. This should be incremented when going down
|
|
|
|
generations and set back to zero when going up generations.
|
|
|
|
skip_handle: an optional handle to skip when going down. This is useful
|
|
|
|
to skip the descendant that brought you this generation in the first
|
|
|
|
place.
|
|
|
|
"""
|
|
|
|
for child_handle in self.get_children_handles(person_handle):
|
|
|
|
if child_handle != skip_handle:
|
|
|
|
self.add_kin(child_handle,Ga,Gb)
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
if self.inc_spouses:
|
2007-08-19 01:39:45 +05:30
|
|
|
for spouse_handle in self.get_spouse_handles(child_handle):
|
|
|
|
self.add_spouse(spouse_handle,Ga,Gb)
|
|
|
|
|
|
|
|
if Gb < self.max_descend:
|
|
|
|
self.traverse_down(child_handle,Ga,Gb+1)
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def traverse_up(self, person_handle, Ga, Gb):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
|
|
|
Populate a map of arrays containing person handles for the ancestors
|
|
|
|
of the passed person. This function calls itself recursively until it
|
|
|
|
reaches max_ascend.
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
person_handle: the handle of the person to go to next
|
|
|
|
Ga: The number of generations from the main person to the common
|
|
|
|
ancestor. This should be incremented when going up generations, and
|
|
|
|
left alone when going down generations.
|
|
|
|
Gb: The number of generations from this person (person_handle) to the
|
|
|
|
common ancestor. This should be incremented when going down
|
|
|
|
generations and set back to zero when going up generations.
|
|
|
|
"""
|
|
|
|
parent_handles = self.get_parent_handles(person_handle)
|
|
|
|
for parent_handle in parent_handles:
|
|
|
|
self.add_kin(parent_handle,Ga,Gb)
|
|
|
|
self.traverse_down(parent_handle,Ga,Gb+1,person_handle)
|
|
|
|
if Ga < self.max_ascend:
|
|
|
|
self.traverse_up(parent_handle,Ga+1,0)
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def add_kin(self, person_handle, Ga, Gb):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
|
|
|
Add a person handle to the kin map.
|
|
|
|
"""
|
2008-07-17 23:40:32 +05:30
|
|
|
if Ga not in self.kinship_map:
|
2007-08-19 01:39:45 +05:30
|
|
|
self.kinship_map[Ga] = {}
|
2008-07-17 23:40:32 +05:30
|
|
|
if Gb not in self.kinship_map[Ga]:
|
2007-08-19 01:39:45 +05:30
|
|
|
self.kinship_map[Ga][Gb] = []
|
|
|
|
if person_handle not in self.kinship_map[Ga][Gb]:
|
|
|
|
self.kinship_map[Ga][Gb].append(person_handle)
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def add_spouse(self, spouse_handle, Ga, Gb):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
|
|
|
Add a person handle to the spouse map.
|
|
|
|
"""
|
2008-07-17 23:40:32 +05:30
|
|
|
if Ga not in self.spouse_map:
|
2007-08-19 01:39:45 +05:30
|
|
|
self.spouse_map[Ga] = {}
|
2008-07-17 23:40:32 +05:30
|
|
|
if Gb not in self.spouse_map[Ga]:
|
2007-08-19 01:39:45 +05:30
|
|
|
self.spouse_map[Ga][Gb] = []
|
|
|
|
if spouse_handle not in self.spouse_map[Ga][Gb]:
|
|
|
|
self.spouse_map[Ga][Gb].append(spouse_handle)
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def get_parent_handles(self, person_handle):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
|
|
|
Return an array of handles for all the parents of the
|
|
|
|
given person handle.
|
|
|
|
"""
|
|
|
|
parent_handles = []
|
2008-01-23 11:11:46 +05:30
|
|
|
person = self.__db.get_person_from_handle(person_handle)
|
2007-08-19 01:39:45 +05:30
|
|
|
family_handle = person.get_main_parents_family_handle()
|
|
|
|
if family_handle:
|
2008-01-23 11:11:46 +05:30
|
|
|
family = self.__db.get_family_from_handle(family_handle)
|
2007-08-19 01:39:45 +05:30
|
|
|
father_handle = family.get_father_handle()
|
|
|
|
if father_handle:
|
|
|
|
parent_handles.append(father_handle)
|
|
|
|
mother_handle = family.get_mother_handle()
|
|
|
|
if mother_handle:
|
|
|
|
parent_handles.append(mother_handle)
|
|
|
|
return parent_handles
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def get_spouse_handles(self, person_handle):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
|
|
|
Return an array of handles for all the spouses of the
|
|
|
|
given person handle.
|
|
|
|
"""
|
|
|
|
spouses = []
|
2008-01-23 11:11:46 +05:30
|
|
|
person = self.__db.get_person_from_handle(person_handle)
|
2007-08-19 01:39:45 +05:30
|
|
|
for family_handle in person.get_family_handle_list():
|
2008-01-23 11:11:46 +05:30
|
|
|
family = self.__db.get_family_from_handle(family_handle)
|
2007-08-19 01:39:45 +05:30
|
|
|
father_handle = family.get_father_handle()
|
|
|
|
mother_handle = family.get_mother_handle()
|
|
|
|
spouse_handle = None
|
|
|
|
if mother_handle and father_handle == person_handle:
|
|
|
|
spouse_handle = mother_handle
|
|
|
|
elif father_handle and mother_handle == person_handle:
|
|
|
|
spouse_handle = father_handle
|
|
|
|
|
|
|
|
if spouse_handle and spouse_handle not in spouses:
|
|
|
|
spouses.append(spouse_handle)
|
|
|
|
return spouses
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def get_children_handles(self, person_handle):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
|
|
|
Return an array of handles for all the children of the
|
|
|
|
given person handle.
|
|
|
|
"""
|
|
|
|
children = []
|
2008-01-23 11:11:46 +05:30
|
|
|
person = self.__db.get_person_from_handle(person_handle)
|
2007-08-19 01:39:45 +05:30
|
|
|
for family_handle in person.get_family_handle_list():
|
2008-01-23 11:11:46 +05:30
|
|
|
family = self.__db.get_family_from_handle(family_handle)
|
2007-08-19 01:39:45 +05:30
|
|
|
for child_ref in family.get_child_ref_list():
|
|
|
|
children.append(child_ref.get_reference_handle())
|
|
|
|
return children
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def get_sibling_handles(self, person_handle):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
|
|
|
Return an array of handles for all the siblings of the
|
|
|
|
given person handle.
|
|
|
|
"""
|
|
|
|
siblings = []
|
2008-01-23 11:11:46 +05:30
|
|
|
person = self.__db.get_person_from_handle(person_handle)
|
2007-08-19 01:39:45 +05:30
|
|
|
family_handle = person.get_main_parents_family_handle()
|
|
|
|
if family_handle:
|
2008-01-23 11:11:46 +05:30
|
|
|
family = self.__db.get_family_from_handle(family_handle)
|
2007-08-19 01:39:45 +05:30
|
|
|
for child_ref in family.get_child_ref_list():
|
|
|
|
sibling_handle = child_ref.get_reference_handle()
|
|
|
|
if sibling_handle != person_handle:
|
|
|
|
siblings.append(sibling_handle)
|
|
|
|
return siblings
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def write_people(self, title, people_handles):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
|
|
|
Write information about a group of people - including the title.
|
|
|
|
"""
|
|
|
|
cap_title = capitalize(title)
|
2008-01-25 07:30:03 +05:30
|
|
|
subtitle = "%s (%d)" % (cap_title, len(people_handles))
|
2007-08-19 01:39:45 +05:30
|
|
|
self.doc.start_paragraph("KIN-Subtitle")
|
2009-05-30 03:55:44 +05:30
|
|
|
mark = IndexMark(cap_title, INDEX_TYPE_TOC, 2)
|
2008-01-25 07:30:03 +05:30
|
|
|
self.doc.write_text(subtitle, mark)
|
2007-08-19 01:39:45 +05:30
|
|
|
self.doc.end_paragraph()
|
|
|
|
for person_handle in people_handles:
|
|
|
|
self.write_person(person_handle)
|
|
|
|
|
2008-01-23 11:11:46 +05:30
|
|
|
def write_person(self, person_handle):
|
2007-08-19 01:39:45 +05:30
|
|
|
"""
|
|
|
|
Write information about the given person.
|
|
|
|
"""
|
|
|
|
person = self.database.get_person_from_handle(person_handle)
|
|
|
|
|
|
|
|
name = name_displayer.display(person)
|
|
|
|
mark = ReportUtils.get_person_mark(self.database, person)
|
|
|
|
birth_date = ""
|
2009-04-10 21:50:41 +05:30
|
|
|
birth = ReportUtils.get_birth_or_fallback(self.database, person)
|
|
|
|
if birth:
|
|
|
|
birth_date = DateHandler.get_date(birth)
|
2007-08-19 01:39:45 +05:30
|
|
|
|
|
|
|
death_date = ""
|
2009-04-10 21:50:41 +05:30
|
|
|
death = ReportUtils.get_death_or_fallback(self.database, person)
|
|
|
|
if death:
|
|
|
|
death_date = DateHandler.get_date(death)
|
2007-08-19 01:39:45 +05:30
|
|
|
dates = _(" (%(birth_date)s - %(death_date)s)") % {
|
|
|
|
'birth_date' : birth_date,
|
|
|
|
'death_date' : death_date }
|
|
|
|
|
|
|
|
self.doc.start_paragraph('KIN-Normal')
|
2008-01-23 11:11:46 +05:30
|
|
|
self.doc.write_text(name, mark)
|
2007-08-19 01:39:45 +05:30
|
|
|
self.doc.write_text(dates)
|
|
|
|
self.doc.end_paragraph()
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# KinshipOptions
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2008-01-06 02:12:05 +05:30
|
|
|
class KinshipOptions(MenuReportOptions):
|
|
|
|
|
2007-08-19 01:39:45 +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-08-19 01:39:45 +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 kinship report.
|
|
|
|
"""
|
|
|
|
category_name = _("Report Options")
|
2007-08-19 01:39:45 +05:30
|
|
|
|
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)
|
|
|
|
|
2008-01-06 02:12:05 +05:30
|
|
|
maxdescend = NumberOption(_("Max Descendant Generations"),2,1,20)
|
|
|
|
maxdescend.set_help(_("The maximum number of descendant generations"))
|
|
|
|
menu.add_option(category_name,"maxdescend",maxdescend)
|
2007-08-19 01:39:45 +05:30
|
|
|
|
2008-01-06 02:12:05 +05:30
|
|
|
maxascend = NumberOption(_("Max Ancestor Generations"),2,1,20)
|
|
|
|
maxascend.set_help(_("The maximum number of ancestor generations"))
|
|
|
|
menu.add_option(category_name,"maxascend",maxascend)
|
2007-08-19 01:39:45 +05:30
|
|
|
|
2008-01-06 02:12:05 +05:30
|
|
|
incspouses = BooleanOption(_("Include spouses"),True)
|
|
|
|
incspouses.set_help(_("Whether to include spouses"))
|
|
|
|
menu.add_option(category_name,"incspouses",incspouses)
|
|
|
|
|
|
|
|
inccousins = BooleanOption(_("Include cousins"),True)
|
|
|
|
inccousins.set_help(_("Whether to include cousins"))
|
|
|
|
menu.add_option(category_name,"inccousins",inccousins)
|
|
|
|
|
|
|
|
incaunts = BooleanOption(_("Include aunts/uncles/nephews/nieces"),True)
|
|
|
|
incaunts.set_help(_("Whether to include aunts/uncles/nephews/nieces"))
|
|
|
|
menu.add_option(category_name,"incaunts",incaunts)
|
2007-08-19 01:39:45 +05:30
|
|
|
|
|
|
|
def make_default_style(self,default_style):
|
|
|
|
"""Make the default output style for the Kinship Report."""
|
2009-05-30 03:55:44 +05:30
|
|
|
f = FontStyle()
|
2007-08-19 01:39:45 +05:30
|
|
|
f.set_size(16)
|
2009-05-30 03:55:44 +05:30
|
|
|
f.set_type_face(FONT_SANS_SERIF)
|
2007-08-19 01:39:45 +05:30
|
|
|
f.set_bold(1)
|
2009-05-30 03:55:44 +05:30
|
|
|
p = ParagraphStyle()
|
2007-08-19 01:39:45 +05:30
|
|
|
p.set_header_level(1)
|
|
|
|
p.set_bottom_border(1)
|
|
|
|
p.set_bottom_margin(ReportUtils.pt2cm(8))
|
|
|
|
p.set_font(f)
|
2009-05-30 03:55:44 +05:30
|
|
|
p.set_alignment(PARA_ALIGN_CENTER)
|
2007-08-19 01:39:45 +05:30
|
|
|
p.set_description(_("The style used for the title of the page."))
|
|
|
|
default_style.add_paragraph_style("KIN-Title",p)
|
|
|
|
|
2009-05-30 03:55:44 +05:30
|
|
|
font = FontStyle()
|
2007-08-19 01:39:45 +05:30
|
|
|
font.set_size(12)
|
|
|
|
font.set_bold(True)
|
2009-05-30 03:55:44 +05:30
|
|
|
p = ParagraphStyle()
|
2009-06-12 13:01:30 +05:30
|
|
|
p.set_header_level(3)
|
2007-08-19 01:39:45 +05:30
|
|
|
p.set_font(font)
|
|
|
|
p.set_top_margin(ReportUtils.pt2cm(6))
|
|
|
|
p.set_description(_('The basic style used for sub-headings.'))
|
|
|
|
default_style.add_paragraph_style("KIN-Subtitle",p)
|
|
|
|
|
2009-05-30 03:55:44 +05:30
|
|
|
font = FontStyle()
|
2007-08-19 01:39:45 +05:30
|
|
|
font.set_size(10)
|
2009-05-30 03:55:44 +05:30
|
|
|
p = ParagraphStyle()
|
2007-08-19 01:39:45 +05:30
|
|
|
p.set_font(font)
|
|
|
|
p.set_left_margin(0.5)
|
|
|
|
p.set_description(_('The basic style used for the text display.'))
|
|
|
|
default_style.add_paragraph_style("KIN-Normal",p)
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Register the plugin
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
2008-05-19 00:54:28 +05:30
|
|
|
pmgr = PluginManager.get_instance()
|
|
|
|
pmgr.register_report(
|
2007-08-19 01:39:45 +05:30
|
|
|
name = 'kinship_report',
|
|
|
|
category = CATEGORY_TEXT,
|
|
|
|
report_class = KinshipReport,
|
|
|
|
options_class = KinshipOptions,
|
2008-10-02 09:32:10 +05:30
|
|
|
modes = PluginManager.REPORT_MODE_GUI | \
|
|
|
|
PluginManager.REPORT_MODE_BKI | \
|
|
|
|
PluginManager.REPORT_MODE_CLI,
|
2008-03-02 04:17:48 +05:30
|
|
|
translated_name = _("Kinship Report"),
|
|
|
|
status = _("Stable"),
|
|
|
|
description = _("Produces a textual report of kinship for a given person"),
|
|
|
|
author_name = "Brian G. Matherly",
|
|
|
|
author_email = "brian@gramps-project.org"
|
2007-08-19 01:39:45 +05:30
|
|
|
)
|