From 79c13bb43d1ad93c53222e14d8f03a88bee3eccf Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Wed, 13 Oct 2004 20:59:23 +0000 Subject: [PATCH] * src/plugins/Makefile.am: Ship rel_es.py plugin. * src/plugins/rel_es.py: Add to CVS. svn: r3628 --- gramps2/ChangeLog | 6 + gramps2/src/plugins/Makefile.am | 5 +- gramps2/src/plugins/rel_es.py | 321 ++++++++++++++++++++++++++++++++ 3 files changed, 330 insertions(+), 2 deletions(-) create mode 100644 gramps2/src/plugins/rel_es.py diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 89c3b9a3a..43a3faa6c 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,9 @@ +2004-10-13 Alex Roitman + * src/plugins/Makefile.am: Ship rel_es.py plugin. + +2004-10-13 Julio Sanchez + * src/plugins/rel_es.py: Add to CVS. + 2004-10-12 Don Allingham * src/DisplayModels.py: fix source display * src/GrampsBSDDB.py: add abort_changes task diff --git a/gramps2/src/plugins/Makefile.am b/gramps2/src/plugins/Makefile.am index 1d72cbc83..67886fbeb 100644 --- a/gramps2/src/plugins/Makefile.am +++ b/gramps2/src/plugins/Makefile.am @@ -57,8 +57,9 @@ pkgdata_PYTHON = \ rel_no.py\ rel_sv.py\ ImportGeneWeb.py\ - WriteGeneWeb.py - + WriteGeneWeb.py\ + rel_es.py + pkgpyexecdir = @pkgpyexecdir@/plugins pkgpythondir = @pkgpythondir@/plugins diff --git a/gramps2/src/plugins/rel_es.py b/gramps2/src/plugins/rel_es.py new file mode 100644 index 000000000..317723f08 --- /dev/null +++ b/gramps2/src/plugins/rel_es.py @@ -0,0 +1,321 @@ +# -*- coding: utf-8 -*- +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2003-2004 Donald N. Allingham +# +# 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$ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- + +import RelLib +import Relationship +import types +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- + +_level_name_male = [ "", "primero", "segundo", "tercero", "cuarto", "quinto", + "sexto", "séptimo", "octavo", "noveno", "décimo", "undécimo", + "duodécimo", "decimotercero", "decimocuarto", "decimoquinto", + "decimosexto", "decimoséptimo", "decimoctavo", "decimonono", + "vigésimo", ] + +# Short forms (in apocope) used before names +_level_name_male_a = [ "", "primer", "segundo", "tercer", "cuarto", "quinto", + "sexto", "séptimo", "octavo", "noveno", "décimo", "undécimo", + "duodécimo", "decimotercer", "decimocuarto", "decimoquinto", + "decimosexto", "decimoséptimo", "decimoctavo", "decimonono", + "vigésimo"] + +_level_name_female = [ "", "primera", "segunda", "tercera", "cuarta", "quinta", + "sexta", "séptima", "octava", "novena", "décima", "undécima", + "duodécima", "decimotercera", "decimocuarta", "decimoquinta", + "decimosexta", "decimoséptima", "decimoctava", "decimonona", + "vigésima"] + +_level_name_plural = [ "", "primeros", "segundos", "terceros", "cuartos", + "quintos", "sextos", "séptimos", "octavos", "novenos", + "décimos", "undécimos", "duodécimos", "decimoterceros", + "decimocuartos", "decimoquintos", "decimosextos", + "decimoséptimos", "decimoctavos", "decimononos", + "vigésimos", ] + +# Higher-order terms (after trastatarabuelo) on this list are not standard, +# but then there is no standard naming scheme at all for this in Spanish. +# Check http://www.genealogia-es.com/guia3.html that echoes a proposed +# scheme that has got some reception in the Spanish-language genealogy +# community. This plugin implements a scheme based on this list. When +# this list is not enough, ordinals are used based on the same idea, i.e. +# bisabuelo is 'segundo abuelo' and so on. When we run out of ordinals +# we resort to N-ésimo notation, that is sort of understandable if in +# context. +_parents_level = [ "", "padres", "abuelos", "bisabuelos", "tatarabuelos", + "trastatarabuelos", "pentabuelos", "hexabuelos", + "heptabuelos", "octabuelos", "eneabuelos", "decabuelos"] + +_father_level = [ "", "padre", "abuelo", "bisabuelo", "tatarabuelo", + "trastatarabuelo", "pentabuelo", "hexabuelo", + "heptabuelo", "octabuelo", "eneabuelo", "decabuelo"] + +_mother_level = [ "", "madre", "abuela", "bisabuela", "tatarabuela", + "trastatarabuela", "pentabuela", "hexabuela", + "heptabuela", "octabuela", "eneabuela", "decabuela"] + +_son_level = [ "", "hijo", "nieto", "bisnieto", + "tataranieto", "trastataranieto", ] + +_daughter_level = [ "", "hija", "nieta", "bisnieta", + "tataranieta", "trastataranieta", ] + +_sister_level = [ "", "hermana", "tía", "tía abuela", + "tía bisabuela", ] + +_brother_level = [ "", "hermano", "tío", "tío abuelo", + "tío bisabuelo", ] + +_nephew_level = [ "", "sobrino", "sobrino nieto", "sobrino bisnieto", ] + +_niece_level = [ "", "sobrina", "sobrina nieta", "sobrina bisnieta", ] + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +class RelationshipCalculator(Relationship.RelationshipCalculator): + + def __init__(self,db): + Relationship.RelationshipCalculator.__init__(self,db) + + def get_male_cousin(self,level): + if level