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

Source Code for Module gen.lib.attrtype

 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: attrtype.py 10103 2008-02-24 13:55:55Z acraphae $ 
22   
23  """ 
24  Provide the different Attribute Types for GRAMPS. 
25  """ 
26   
27  #------------------------------------------------------------------------- 
28  # 
29  # Standard Python modules 
30  # 
31  #------------------------------------------------------------------------- 
32  from gettext import gettext as _ 
33  #------------------------------------------------------------------------- 
34  # 
35  # GRAMPS modules 
36  # 
37  #------------------------------------------------------------------------- 
38  from gen.lib.grampstype import GrampsType, init_map 
39   
40 -class AttributeType(GrampsType):
41 42 UNKNOWN = -1 43 CUSTOM = 0 44 CASTE = 1 45 DESCRIPTION = 2 46 ID = 3 47 NATIONAL = 4 48 NUM_CHILD = 5 49 SSN = 6 50 NICKNAME = 7 51 CAUSE = 8 52 AGENCY = 9 53 AGE = 10 54 FATHER_AGE = 11 55 MOTHER_AGE = 12 56 WITNESS = 13 57 58 _CUSTOM = CUSTOM 59 _DEFAULT = ID 60 61 _DATAMAP = [ 62 (UNKNOWN , _("Unknown"), "Unknown"), 63 (CUSTOM , _("Custom"), "Custom"), 64 (CASTE , _("Caste"), "Caste"), 65 (DESCRIPTION , _("Description"), "Description"), 66 (ID , _("Identification Number"), "Identification Number"), 67 (NATIONAL , _("National Origin"), "National Origin"), 68 (NUM_CHILD , _("Number of Children"), "Number of Children"), 69 (SSN , _("Social Security Number"), "Social Security Number"), 70 (NUM_CHILD , _("Number of Children"), "Number of Children"), 71 (NICKNAME , _("Nickname"), "Nickname"), 72 (CAUSE , _("Cause"), "Cause"), 73 (AGENCY , _("Agency"), "Agency"), 74 (AGE , _("Age"), "Age"), 75 (FATHER_AGE , _("Father's Age"), "Father Age"), 76 (MOTHER_AGE , _("Mother's Age"), "Mother Age"), 77 (WITNESS , _("Witness"), "Witness"), 78 ] 79 80 _I2SMAP = init_map(_DATAMAP, 0, 1) 81 _S2IMAP = init_map(_DATAMAP, 1, 0) 82 _I2EMAP = init_map(_DATAMAP, 0, 2) 83 _E2IMAP = init_map(_DATAMAP, 2, 0) 84
85 - def __init__(self, value=None):
86 GrampsType.__init__(self, value)
87