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

Source Code for Module gen.lib.nametype

 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   
21  # $Id: nametype.py 10103 2008-02-24 13:55:55Z acraphae $ 
22   
23  """ 
24  Name types. 
25  """ 
26   
27  #------------------------------------------------------------------------- 
28  # 
29  # Python modules 
30  # 
31  #------------------------------------------------------------------------- 
32  from gettext import gettext as _ 
33   
34  #------------------------------------------------------------------------- 
35  # 
36  # GRAMPS modules 
37  # 
38  #------------------------------------------------------------------------- 
39  from gen.lib.grampstype import GrampsType, init_map 
40   
41 -class NameType(GrampsType):
42 43 UNKNOWN = -1 44 CUSTOM = 0 45 AKA = 1 46 BIRTH = 2 47 MARRIED = 3 48 49 _CUSTOM = CUSTOM 50 _DEFAULT = BIRTH 51 52 _DATAMAP = [ 53 (UNKNOWN, _("Unknown"), "Unknown"), 54 (CUSTOM, _("Custom"), "Custom"), 55 (AKA, _("Also Known As"), "Also Known As"), 56 (BIRTH, _("Birth Name"), "Birth Name"), 57 (MARRIED, _("Married Name"), "Married Name"), 58 ] 59 60 _I2SMAP = init_map(_DATAMAP, 0, 1) 61 _S2IMAP = init_map(_DATAMAP, 1, 0) 62 _I2EMAP = init_map(_DATAMAP, 0, 2) 63 _E2IMAP = init_map(_DATAMAP, 2, 0) 64
65 - def __init__(self, value=None):
66 GrampsType.__init__(self, value)
67