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

Source Code for Module gen.lib.repotype

 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: repotype.py 10103 2008-02-24 13:55:55Z acraphae $ 
22   
23  """ 
24  Repository 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 RepositoryType(GrampsType):
42 43 UNKNOWN = -1 44 CUSTOM = 0 45 LIBRARY = 1 46 CEMETERY = 2 47 CHURCH = 3 48 ARCHIVE = 4 49 ALBUM = 5 50 WEBSITE = 6 51 BOOKSTORE = 7 52 COLLECTION = 8 53 SAFE = 9 54 55 _CUSTOM = CUSTOM 56 _DEFAULT = LIBRARY 57 58 _DATAMAP = [ 59 (UNKNOWN, _("Unknown"), "Unknown"), 60 (CUSTOM, _("Custom"), "Custom"), 61 (LIBRARY, _("Library"), "Library"), 62 (CEMETERY, _("Cemetery"), "Cemetery"), 63 (CHURCH, _("Church"), "Church"), 64 (ARCHIVE, _("Archive"), "Archive"), 65 (ALBUM, _("Album"), "Album"), 66 (WEBSITE, _("Web site"), "Web site"), 67 (BOOKSTORE, _("Bookstore"), "Bookstore"), 68 (COLLECTION, _("Collection"), "Collection"), 69 (SAFE, _("Safe"), "Safe"), 70 ] 71 72 _I2SMAP = init_map(_DATAMAP, 0, 1) 73 _S2IMAP = init_map(_DATAMAP, 1, 0) 74 _I2EMAP = init_map(_DATAMAP, 0, 2) 75 _E2IMAP = init_map(_DATAMAP, 2, 0) 76
77 - def __init__(self, value=None):
78 GrampsType.__init__(self, value)
79