1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """
24 Proxy class for the GRAMPS databases. Apply filter
25 """
26
27
28
29
30
31
32
33 from proxybase import ProxyDbBase
34
36 """
37 A proxy to a Gramps database. This proxy will act like a Gramps database,
38 but all data marked private will be hidden from the user.
39 """
40
41 - def __init__(self, db, person_filter=None, event_filter=None):
65
102
104 """
105 Finds a Source in the database from the passed gramps' ID.
106 If no such Source exists, None is returned.
107 """
108 return self.db.get_source_from_handle(handle)
109
111 """
112 Finds an Object in the database from the passed gramps' ID.
113 If no such Object exists, None is returned.
114 """
115 return self.db.get_object_from_handle(handle)
116
118 """
119 Finds a Place in the database from the passed gramps' ID.
120 If no such Place exists, None is returned.
121 """
122 return self.db.get_place_from_handle(handle)
123
125 """
126 Finds a Event in the database from the passed gramps' ID.
127 If no such Event exists, None is returned.
128 """
129 if handle in self.elist:
130 return self.db.get_event_from_handle(handle)
131 else:
132 return None
133
158
160 """
161 Finds a Repository in the database from the passed gramps' ID.
162 If no such Repository exists, None is returned.
163 """
164 return self.db.get_repository_from_handle(handle)
165
167 """
168 Finds a Note in the database from the passed gramps' ID.
169 If no such Note exists, None is returned.
170 """
171 return self.db.get_note_from_handle(handle)
172
183
185 """
186 Finds a Family in the database from the passed GRAMPS ID.
187 If no such Family exists, None is returned.
188 """
189 return self.db.get_family_from_gramps_id(val)
190
201
203 """
204 Finds a Place in the database from the passed gramps' ID.
205 If no such Place exists, None is returned.
206 """
207 return self.db.get_place_from_gramps_id(val)
208
210 """
211 Finds a Source in the database from the passed gramps' ID.
212 If no such Source exists, None is returned.
213 """
214 return self.db.get_source_from_gramps_id(val)
215
217 """
218 Finds a MediaObject in the database from the passed gramps' ID.
219 If no such MediaObject exists, None is returned.
220 """
221 return self.db.get_object_from_gramps_id(val)
222
224 """
225 Finds a Repository in the database from the passed gramps' ID.
226 If no such Repository exists, None is returned.
227 """
228 return self.db.get_repository_from_gramps_id(val)
229
231 """
232 Finds a Note in the database from the passed gramps' ID.
233 If no such Note exists, None is returned.
234 """
235 return self.db.get_note_from_gramps_id(val)
236
238 """
239 Return a list of database handles, one handle for each Person in
240 the database. If sort_handles is True, the list is sorted by surnames
241 """
242 return list(self.plist)
243
245 """
246 Return a list of database handles, one handle for each Place in
247 the database. If sort_handles is True, the list is sorted by
248 Place title.
249 """
250 return self.db.get_place_handles(sort_handles)
251
253 """
254 Return a list of database handles, one handle for each Source in
255 the database. If sort_handles is True, the list is sorted by
256 Source title.
257 """
258 return self.db.get_source_handles(sort_handles)
259
266
268 """
269 Return a list of database handles, one handle for each Event in
270 the database.
271 """
272 return list(self.elist)
273
275 """
276 Return a list of database handles, one handle for each Family in
277 the database.
278 """
279 return list(self.flist)
280
282 """
283 Return a list of database handles, one handle for each Repository in
284 the database.
285 """
286 return self.db.get_repository_handles()
287
289 """
290 Return a list of database handles, one handle for each Note in
291 the database.
292 """
293 return self.db.get_note_handles()
294
296 """returns the Researcher instance, providing information about
297 the owner of the database"""
298 return self.db.get_researcher()
299
307
309 """returns the default Person of the database"""
310 handle = self.db.get_default_handle()
311 if handle in self.plist:
312 return handle
313 else:
314 return None
315
317 """
318 returns True if the handle exists in the current Person database.
319 """
320 return handle in self.plist
321
323 """
324 returns True if the handle exists in the current Event database.
325 """
326 return handle in self.elist
327
329 """
330 returns True if the handle exists in the current Source database.
331 """
332 return self.db.has_source_handle(handle)
333
335 """
336 returns True if the handle exists in the current Place database.
337 """
338 return self.db.has_place_handle(handle)
339
341 """
342 returns True if the handle exists in the current Family database.
343 """
344 return self.db.has_family_handle(handle)
345
347 """
348 returns True if the handle exists in the current MediaObjectdatabase.
349 """
350 return self.db.has_object_handle(handle)
351
353 """
354 returns True if the handle exists in the current Repository database.
355 """
356 return self.db.has_repository_handle(handle)
357
359 """
360 returns True if the handle exists in the current Note database.
361 """
362 return self.db.has_note_handle(handle)
363