Package gen :: Package lib :: Module familyreltype
[frames] | no frames]

Source Code for Module gen.lib.familyreltype

 1  # 
 2  # Gramps - a GTK+/GNOME based genealogy program 
 3  # 
 4  # Copyright (C) 2000-2006  Donald N. Allingham 
 5  # 
 6  # This program is free software; you can redistribute it and/or modify 
 7  # it under the terms of the GNU General Public License as published by 
 8  # the Free Software Foundation; either version 2 of the License, or 
 9  # (at your option) any later version. 
10  # 
11  # This program is distributed in the hope that it will be useful, 
12  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
13  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
14  # GNU General Public License for more details. 
15  # 
16  # You should have received a copy of the GNU General Public License 
17  # along with this program; if not, write to the Free Software 
18  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
19  # 
20  # $Id: familyreltype.py 10103 2008-02-24 13:55:55Z acraphae $ 
21   
22  """ 
23  Provide the different family reference types. 
24  """ 
25  #------------------------------------------------------------------------ 
26  # 
27  # Python modules 
28  # 
29  #------------------------------------------------------------------------ 
30  from gettext import gettext as _ 
31   
32  #------------------------------------------------------------------------- 
33  # 
34  # GRAMPS modules 
35  # 
36  #------------------------------------------------------------------------- 
37  from gen.lib.grampstype import GrampsType, init_map 
38   
39 -class FamilyRelType(GrampsType):
40 41 MARRIED = 0 42 UNMARRIED = 1 43 CIVIL_UNION = 2 44 UNKNOWN = 3 45 CUSTOM = 4 46 47 _CUSTOM = CUSTOM 48 _DEFAULT = MARRIED 49 50 _DATAMAP = [ 51 (UNKNOWN, _("Unknown"), "Unknown"), 52 (CUSTOM, _("Custom"), "Custom"), 53 (CIVIL_UNION, _("Civil Union"), "Civil Union"), 54 (UNMARRIED, _("Unmarried"), "Unmarried"), 55 (MARRIED, _("Married"), "Married"), 56 ] 57 58 _I2SMAP = init_map(_DATAMAP, 0, 1) 59 _S2IMAP = init_map(_DATAMAP, 1, 0) 60 _I2EMAP = init_map(_DATAMAP, 0, 2) 61 _E2IMAP = init_map(_DATAMAP, 2, 0) 62
63 - def __init__(self, value=None):
64 if value == None: 65 value = self.UNKNOWN 66 GrampsType.__init__(self, value)
67