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. Filter out all data marked private.
25 """
26
27
28
29
30
31
32 from dbbase import DbBase
33
35 """
36 A proxy to a Gramps database. This proxy will act like a Gramps database,
37 but all data marked private will be hidden from the user.
38 """
39
41 """
42 Create a new PrivateProxyDb instance.
43 """
44 self.db = db
45 self.name_formats = db.name_formats
46 self.bookmarks = db.bookmarks
47 self.family_bookmarks = db.family_bookmarks
48 self.event_bookmarks = db.event_bookmarks
49 self.place_bookmarks = db.place_bookmarks
50 self.source_bookmarks = db.source_bookmarks
51 self.repo_bookmarks = db.repo_bookmarks
52 self.media_bookmarks = db.media_bookmarks
53 self.note_bookmarks = db.note_bookmarks
54
56 """
57 Return 1 if the database has been opened.
58 """
59 return self.db.is_open
60
66
72
74 """
75 Return the defined names that have been assigned to a default grouping
76 """
77 return self.db.get_name_group_keys()
78
80 """
81 Return the number of people currently in the databse.
82 """
83 return len(self.get_person_handles())
84
86 """
87 Return the number of families currently in the databse.
88 """
89 return len(self.get_family_handles())
90
92 """
93 Return the number of events currently in the databse.
94 """
95 return len(self.get_event_handles())
96
98 """
99 Return the number of places currently in the databse.
100 """
101 return len(self.get_place_handles())
102
104 """
105 Return the number of sources currently in the databse.
106 """
107 return len(self.get_source_handles())
108
114
116 """
117 Return the number of source repositories currently in the databse.
118 """
119 return len(self.get_repository_handles())
120
122 """
123 Return the number of notes currently in the databse.
124 """
125 return self.db.get_number_of_notes()
126
128 """returns the save path of the file, or "" if one does not exist"""
129 return self.db.get_save_path()
130
132 """returns a list of all Event types assocated with Person
133 instances in the database"""
134 return self.db.get_person_event_types()
135
137 """returns a list of all Attribute types assocated with Person
138 instances in the database"""
139 return self.db.get_person_attribute_types()
140
142 """returns a list of all Attribute types assocated with Family
143 instances in the database"""
144 return self.db.get_family_attribute_types()
145
147 """returns a list of all Event types assocated with Family
148 instances in the database"""
149 return self.db.get_family_event_types()
150
152 """return a list of all marker types available in the database"""
153 return self.db.get_marker_types()
154
159
161 """returns a list of all relationship types assocated with Family
162 instances in the database"""
163 return self.db.get_family_relation_types()
164
166 """returns a list of all child reference types assocated with Family
167 instances in the database"""
168 return self.db.get_child_reference_types()
169
171 """returns a list of all custom event role names assocated with Event
172 instances in the database"""
173 return self.db.get_event_roles()
174
176 """returns a list of all custom names types assocated with Person
177 instances in the database"""
178 return self.db.get_name_types()
179
181 """returns a list of all custom repository types assocated with
182 Repository instances in the database"""
183 return self.db.get_repository_types()
184
186 """returns a list of all custom note types assocated with
187 Note instances in the database"""
188 return self.db.get_note_types()
189
194
196 """returns a list of all custom names types assocated with Url
197 instances in the database"""
198 return self.db.get_url_types()
199
202
205
208
211
214
217
220
223
225 """
226 returns True if the handle exists in the current Person database.
227 """
228 raise NotImplementedError
229
231 """
232 returns True if the handle exists in the current Event database.
233 """
234 raise NotImplementedError
235
237 """
238 returns True if the handle exists in the current Source database.
239 """
240 raise NotImplementedError
241
243 """
244 returns True if the handle exists in the current Place database.
245 """
246 raise NotImplementedError
247
249 """
250 returns True if the handle exists in the current Family database.
251 """
252 raise NotImplementedError
253
255 """
256 returns True if the handle exists in the current MediaObjectdatabase.
257 """
258 raise NotImplementedError
259
261 """
262 returns True if the handle exists in the current Repository database.
263 """
264 raise NotImplementedError
265
267 """
268 returns True if the handle exists in the current Note database.
269 """
270 raise NotImplementedError
271
275
277 raise NotImplementedError
278
280 """
281 Stores the Person display common information in the
282 database's metadata.
283 """
284 raise NotImplementedError
285
287 """
288 Stores the Person display common information in the
289 database's metadata.
290 """
291 raise NotImplementedError
292
294 """
295 Stores the Person display common information in the
296 database's metadata.
297 """
298 raise NotImplementedError
299
301 """
302 Stores the Place display common information in the
303 database's metadata.
304 """
305 raise NotImplementedError
306
308 """
309 Stores the Source display common information in the
310 database's metadata.
311 """
312 raise NotImplementedError
313
320
322 """
323 Stores the Event display common information in the
324 database's metadata.
325 """
326 raise NotImplementedError
327
329 """
330 Stores the Repository display common information in the
331 database's metadata.
332 """
333 raise NotImplementedError
334
336 """
337 Stores the Note display common information in the
338 database's metadata.
339 """
340 raise NotImplementedError
341
343 """
344 Return the Person display common information stored in the
345 database's metadata.
346 """
347 raise NotImplementedError
348
350 """
351 Return the Person display common information stored in the
352 database's metadata.
353 """
354 raise NotImplementedError
355
357 """
358 Return the Person display common information stored in the
359 database's metadata.
360 """
361 raise NotImplementedError
362
364 """
365 Return the Place display common information stored in the
366 database's metadata.
367 """
368 raise NotImplementedError
369
371 """
372 Return the Source display common information stored in the
373 database's metadata.
374 """
375 raise NotImplementedError
376
383
385 """
386 Return the Event display common information stored in the
387 database's metadata.
388 """
389 raise NotImplementedError
390
392 """
393 Return the Repository display common information stored in the
394 database's metadata.
395 """
396 raise NotImplementedError
397
399 """
400 Return the Note display common information stored in the
401 database's metadata.
402 """
403 raise NotImplementedError
404
406 """Called each time an object is removed from the database. This can
407 be used by subclasses to update any additional index tables that might
408 need to be changed."""
409 raise NotImplementedError
410
412 """Called each time an object is writen to the database. This can
413 be used by subclasses to update any additional index tables that might
414 need to be changed."""
415 raise NotImplementedError
416
418 """
419 Reindex all primary records in the database.
420
421 """
422 raise NotImplementedError
423
425 """
426 Find all objects that hold a reference to the object handle.
427 Returns an interator over alist of (class_name, handle) tuples.
428
429 @param handle: handle of the object to search for.
430 @type handle: database handle
431 @param include_classes: list of class names to include in the results.
432 Default: None means include all classes.
433 @type include_classes: list of class names
434
435 This default implementation does a sequencial scan through all
436 the primary object databases and is very slow. Backends can
437 override this method to provide much faster implementations that
438 make use of additional capabilities of the backend.
439
440 Note that this is a generator function, it returns a iterator for
441 use in loops. If you want a list of the results use:
442
443 > result_list = [i for i in find_backlink_handles(handle)]
444 """
445 raise NotImplementedError
446
449
451 return self.db.has_gramps_ids(obj_key, gramps_id)
452
454 """returns the list of Person handles in the bookmarks"""
455 return self.bookmarks
456
458 """returns the list of Person handles in the bookmarks"""
459 return self.family_bookmarks
460
462 """returns the list of Person handles in the bookmarks"""
463 return self.event_bookmarks
464
466 """returns the list of Person handles in the bookmarks"""
467 return self.place_bookmarks
468
470 """returns the list of Person handles in the bookmarks"""
471 return self.source_bookmarks
472
476
478 """returns the list of Person handles in the bookmarks"""
479 return self.repo_bookmarks
480
482 """returns the list of Note handles in the bookmarks"""
483 return self.note_bookmarks
484