1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """
24 Note types.
25 """
26
27
28
29
30
31
32 from gettext import gettext as _
33
34
35
36
37
38
39 from gen.lib.grampstype import GrampsType, init_map
40
42
43 UNKNOWN = -1
44 CUSTOM = 0
45 GENERAL = 1
46 RESEARCH = 2
47 TRANSCRIPT = 3
48
49 PERSON = 4
50 ATTRIBUTE = 5
51 ADDRESS = 6
52 ASSOCIATION = 7
53 LDS = 8
54 FAMILY = 9
55 EVENT = 10
56 EVENTREF = 11
57 SOURCE = 12
58 SOURCEREF = 13
59 PLACE = 14
60 REPO = 15
61 REPOREF = 16
62 MEDIA = 17
63 MEDIAREF = 18
64 CHILDREF = 19
65 PERSONNAME = 20
66
67 SOURCE_TEXT = 21
68 CITATION = 22
69 REPORT_TEXT = 23
70
71 _CUSTOM = CUSTOM
72 _DEFAULT = GENERAL
73
74
75 _DATAMAPREAL = [
76 (UNKNOWN, _("Unknown"), "Unknown"),
77 (CUSTOM, _("Custom"), "Custom"),
78 (GENERAL, _("General"), "General"),
79 (RESEARCH, _("Research"), "Research"),
80 (TRANSCRIPT, _("Transcript"), "Transcript"),
81 (SOURCE_TEXT, _("Source text"), "Source text"),
82 (CITATION, _('Citation'), "Citation"),
83 (REPORT_TEXT, _("Report"), "Report"),
84 ]
85
86 _DATAMAPIGNORE = [
87 (PERSON, _("Person Note"),"Person Note"),
88 (PERSONNAME, _("Name Note"), "Name Note"),
89 (ATTRIBUTE, _("Attribute Note"), "Attribute Note"),
90 (ADDRESS, _("Address Note"), "Address Note"),
91 (ASSOCIATION,_("Association Note"), "Association Note"),
92 (LDS, _("LDS Note"), "LDS Note"),
93 (FAMILY, _("Family Note"),"Family Note"),
94 (EVENT, _("Event Note"), "Event Note"),
95 (EVENTREF, _("Event Reference Note"), "Event Reference Note"),
96 (SOURCE, _("Source Note"), "Source Note"),
97 (SOURCEREF, _("Source Reference Note"), "Source Reference Note"),
98 (PLACE, _("Place Note"), "Place Note"),
99 (REPO, _("Repository Note"), "Repository Note"),
100 (REPOREF, _("Repository Reference Note"),
101 "Repository Reference Note"),
102 (MEDIA, _("Media Note"), "Media Note"),
103 (MEDIAREF, _("Media Reference Note"), "Media Reference Note"),
104 (CHILDREF, _("Child Reference Note"), "Child Reference Note"),
105 ]
106
107 _DATAMAP = _DATAMAPREAL + _DATAMAPIGNORE
108
109 _I2SMAP = init_map(_DATAMAP, 0, 1)
110 _S2IMAP = init_map(_DATAMAP, 1, 0)
111 _I2EMAP = init_map(_DATAMAP, 0, 2)
112 _E2IMAP = init_map(_DATAMAP, 2, 0)
113
116
118 """
119 Return a list of the types to ignore and not include in default lists.
120
121 Exception is a sublist of types that may not be ignored
122
123 @param exception: list of integer values corresponding with types that
124 have to be excluded from the ignore list
125 @type exception: list
126 @returns: list of integers corresponding with the types to ignore when
127 showing a list of different NoteType's
128 @rtype: list
129 """
130 ignlist = [x[0] for x in self._DATAMAPIGNORE]
131 if exception:
132 for type in exception :
133 try:
134 del ignlist[ignlist.index(type)]
135 except ValueError:
136 pass
137 return ignlist
138