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 from gettext import gettext as _
28
29
30
31
32
33
34
35 from gen.lib import *
36
38 """
39 A proxy to a Gramps database. This proxy will act like a Gramps database,
40 but all data marked private will be hidden from the user.
41 """
42
43 - def set_prefixes(self, person, media, family, source, place, event,
44 repository, note):
45 raise NotImplementedError
46
48 raise NotImplementedError
49
51 """ Return True when the file has a supported version"""
52 raise NotImplementedError
53
55 raise NotImplementedError
56
58 raise NotImplementedError
59
61 raise NotImplementedError
62
64 raise NotImplementedError
65
67 raise NotImplementedError
68
70 raise NotImplementedError
71
73 raise NotImplementedError
74
77
79 raise NotImplementedError
80
82 raise NotImplementedError
83
85 raise NotImplementedError
86
88 raise NotImplementedError
89
91 raise NotImplementedError
92
94 raise NotImplementedError
95
97 raise NotImplementedError
98
100 raise NotImplementedError
101
103 raise NotImplementedError
104
106 raise NotImplementedError
107
109 raise NotImplementedError
110
112 raise NotImplementedError
113
115 raise NotImplementedError
116
119
122
124 raise NotImplementedError
125
127 raise NotImplementedError
128
130 raise NotImplementedError
131
133 raise NotImplementedError
134
136 raise NotImplementedError
137
139 raise NotImplementedError
140
141 - def load(self, name, callback, mode="w"):
142 """
143 Opens the specified database. The method needs to be overridden
144 in the derived class.
145 """
146 raise NotImplementedError
147
148 - def load_from(self, other_database, filename, callback):
149 """
150 Loads data from the other database into itself.
151 The filename is the name of the file for the newly created database.
152 The method needs to be overridden in the derived class.
153 """
154 raise NotImplementedError
155
157 """
158 Closes the specified database. The method needs to be overridden
159 in the derived class.
160 """
161 raise NotImplementedError
162
164 """
165 Return 1 if the database has been opened.
166 """
167 raise NotImplementedError
168
170 raise NotImplementedError
171
172 - def commit_base(self, obj, data_map, key, update_list, add_list,
173 transaction, change_time):
174 raise NotImplementedError
175
177 raise NotImplementedError
178
181
183 raise NotImplementedError
184
185 - def commit_place(self, place, transaction, change_time=None):
186 raise NotImplementedError
187
189 raise NotImplementedError
190
192 raise NotImplementedError
193
194 - def commit_event(self, event, transaction, change_time=None):
195 raise NotImplementedError
196
198 raise NotImplementedError
199
201 raise NotImplementedError
202
203 - def commit_note(self, note, transaction, change_time=None):
204 raise NotImplementedError
205
207 raise NotImplementedError
208
210 raise NotImplementedError
211
213 raise NotImplementedError
214
216 raise NotImplementedError
217
219 raise NotImplementedError
220
222 raise NotImplementedError
223
225 raise NotImplementedError
226
228 raise NotImplementedError
229
231 """
232 Finds a Person in the database from the passed gramps' ID.
233 If no such Person exists, None is returned.
234 """
235 raise NotImplementedError
236
238 """
239 Finds a Source in the database from the passed gramps' ID.
240 If no such Source exists, None is returned.
241 """
242 raise NotImplementedError
243
245 """
246 Finds an Object in the database from the passed gramps' ID.
247 If no such Object exists, None is returned.
248 """
249 raise NotImplementedError
250
252 """
253 Finds a Place in the database from the passed gramps' ID.
254 If no such Place exists, None is returned.
255 """
256 raise NotImplementedError
257
259 """
260 Finds a Event in the database from the passed gramps' ID.
261 If no such Event exists, None is returned.
262 """
263 raise NotImplementedError
264
266 """
267 Finds a Family in the database from the passed gramps' ID.
268 If no such Family exists, None is returned.
269 """
270 raise NotImplementedError
271
273 """
274 Finds a Repository in the database from the passed gramps' ID.
275 If no such Repository exists, None is returned.
276 """
277 raise NotImplementedError
278
280 """
281 Finds a Note in the database from the passed gramps' ID.
282 If no such Note exists, None is returned.
283 """
284 raise NotImplementedError
285
287 """
288 Finds a Person in the database from the passed GRAMPS ID.
289 If no such Person exists, a new Person is added to the database.
290 """
291 raise NotImplementedError
292
294 """
295 Finds a Source in the database from the passed handle.
296 If no such Source exists, a new Source is added to the database.
297 """
298 raise NotImplementedError
299
301 """
302 Finds a Event in the database from the passed handle.
303 If no such Event exists, a new Event is added to the database.
304 """
305 raise NotImplementedError
306
308 """
309 Finds an MediaObject in the database from the passed handle.
310 If no such MediaObject exists, a new Object is added to the database.
311 """
312 raise NotImplementedError
313
315 """
316 Finds a Place in the database from the passed handle.
317 If no such Place exists, a new Place is added to the database.
318 """
319 raise NotImplementedError
320
322 """
323 Finds a Family in the database from the passed handle.
324 If no such Family exists, a new Family is added to the database.
325 """
326 raise NotImplementedError
327
329 """
330 Finds a Repository in the database from the passed handle.
331 If no such Repository exists, a new Repository is added to the database.
332 """
333 raise NotImplementedError
334
336 """
337 Finds a Note in the database from the passed handle.
338 If no such Note exists, a new Note is added to the database.
339 """
340 raise NotImplementedError
341
343 """
344 Checks whether a Person with the passed handle exists in the database.
345 If no such Person exists, a new Person is added to the database.
346 """
347 raise NotImplementedError
348
350 """
351 Checks whether a Source with the passed handle exists in the database.
352 If no such Source exists, a new Source is added to the database.
353 """
354 raise NotImplementedError
355
357 """
358 Checks whether an Event with the passed handle exists in the database.
359 If no such Event exists, a new Event is added to the database.
360 """
361 raise NotImplementedError
362
364 """
365 Checks whether a MediaObject with the passed handle exists in
366 the database. If no such MediaObject exists, a new Object is
367 added to the database.
368 """
369 raise NotImplementedError
370
372 """
373 Checks whether a Place with the passed handle exists in the database.
374 If no such Place exists, a new Place is added to the database.
375 """
376 raise NotImplementedError
377
379 """
380 Checks whether a Family with the passed handle exists in the database.
381 If no such Family exists, a new Family is added to the database.
382 """
383 raise NotImplementedError
384
386 """
387 Checks whether a Repository with the passed handle exists in the
388 database. If no such Repository exists, a new Repository is added
389 to the database.
390 """
391 raise NotImplementedError
392
394 """
395 Checks whether a Note with the passed handle exists in the
396 database. If no such Note exists, a new Note is added
397 to the database.
398 """
399 raise NotImplementedError
400
402 """
403 Finds a Person in the database from the passed GRAMPS ID.
404 If no such Person exists, None is returned.
405 """
406 raise NotImplementedError
407
409 """
410 Finds a Family in the database from the passed GRAMPS ID.
411 If no such Family exists, None is returned.
412 """
413 raise NotImplementedError
414
416 """
417 Finds an Event in the database from the passed GRAMPS ID.
418 If no such Event exists, None is returned.
419 """
420 raise NotImplementedError
421
423 """
424 Finds a Place in the database from the passed gramps' ID.
425 If no such Place exists, None is returned.
426 """
427 raise NotImplementedError
428
430 """
431 Finds a Source in the database from the passed gramps' ID.
432 If no such Source exists, None is returned.
433 """
434 raise NotImplementedError
435
437 """
438 Finds a MediaObject in the database from the passed gramps' ID.
439 If no such MediaObject exists, None is returned.
440 """
441 raise NotImplementedError
442
444 """
445 Finds a Repository in the database from the passed gramps' ID.
446 If no such Repository exists, None is returned.
447 """
448 raise NotImplementedError
449
451 """
452 Finds a Note in the database from the passed gramps' ID.
453 If no such Note exists, None is returned.
454 """
455 raise NotImplementedError
456
458 """
459 Add a Person to the database, assigning internal IDs if they have
460 not already been defined.
461 """
462 raise NotImplementedError
463
465 """
466 Add a Family to the database, assigning internal IDs if they have
467 not already been defined.
468 """
469 raise NotImplementedError
470
472 """
473 Add a Source to the database, assigning internal IDs if they have
474 not already been defined.
475 """
476 raise NotImplementedError
477
479 """
480 Add an Event to the database, assigning internal IDs if they have
481 not already been defined.
482 """
483 raise NotImplementedError
484
486 """
487 Add an Event to the database, assigning internal IDs if they have
488 not already been defined.
489 """
490 raise NotImplementedError
491
493 """
494 Add an Event to the database, assigning internal IDs if they have
495 not already been defined.
496 """
497 raise NotImplementedError
498
500 """
501 Add a Place to the database, assigning internal IDs if they have
502 not already been defined.
503 """
504 raise NotImplementedError
505
507 """
508 Add a MediaObject to the database, assigning internal IDs if they have
509 not already been defined.
510 """
511 raise NotImplementedError
512
514 """
515 Add a Repository to the database, assigning internal IDs if they have
516 not already been defined.
517 """
518 raise NotImplementedError
519
521 """
522 Add a Note to the database, assigning internal IDs if they have
523 not already been defined.
524 """
525 raise NotImplementedError
526
528 """
529 Return the default grouping name for a surname
530 """
531 raise NotImplementedError
532
534 """
535 Return if a key exists in the name_group table
536 """
537 raise NotImplementedError
538
540 """
541 Return the defined names that have been assigned to a default grouping
542 """
543 raise NotImplementedError
544
546 """
547 Set the default grouping name for a surname. Needs to be overridden
548 in the derived class.
549 """
550 raise NotImplementedError
551
553 """
554 Return the number of people currently in the databse.
555 """
556 raise NotImplementedError
557
559 """
560 Return the number of families currently in the databse.
561 """
562 raise NotImplementedError
563
565 """
566 Return the number of events currently in the databse.
567 """
568 raise NotImplementedError
569
571 """
572 Return the number of places currently in the databse.
573 """
574 raise NotImplementedError
575
577 """
578 Return the number of sources currently in the databse.
579 """
580 raise NotImplementedError
581
587
589 """
590 Return the number of source repositories currently in the databse.
591 """
592 raise NotImplementedError
593
595 """
596 Return the number of notes currently in the databse.
597 """
598 raise NotImplementedError
599
601 """
602 Return a list of database handles, one handle for each Person in
603 the database. If sort_handles is True, the list is sorted by surnames
604 """
605 raise NotImplementedError
606
608 """
609 Return a list of database handles, one handle for each Place in
610 the database. If sort_handles is True, the list is sorted by
611 Place title.
612 """
613 raise NotImplementedError
614
616 """
617 Return a list of database handles, one handle for each Source in
618 the database. If sort_handles is True, the list is sorted by
619 Source title.
620 """
621 raise NotImplementedError
622
629
631 """
632 Return a list of database handles, one handle for each Event in
633 the database.
634 """
635 raise NotImplementedError
636
638 """
639 Return a list of database handles, one handle for each Family in
640 the database.
641 """
642 raise NotImplementedError
643
645 """
646 Return a list of database handles, one handle for each Repository in
647 the database.
648 """
649 raise NotImplementedError
650
652 """
653 Return a list of database handles, one handle for each Note in
654 the database.
655 """
656 raise NotImplementedError
657
659 raise NotImplementedError
660
662 raise NotImplementedError
663
665 raise NotImplementedError
666
668 """
669 Set the naming template for GRAMPS Person ID values. The string is
670 expected to be in the form of a simple text string, or in a format
671 that contains a C/Python style format string using %d, such as I%d
672 or I%04d.
673 """
674 raise NotImplementedError
675
677 """
678 Set the naming template for GRAMPS Source ID values. The string is
679 expected to be in the form of a simple text string, or in a format
680 that contains a C/Python style format string using %d, such as S%d
681 or S%04d.
682 """
683 raise NotImplementedError
684
686 """
687 Set the naming template for GRAMPS MediaObject ID values. The string
688 is expected to be in the form of a simple text string, or in a format
689 that contains a C/Python style format string using %d, such as O%d
690 or O%04d.
691 """
692 raise NotImplementedError
693
695 """
696 Set the naming template for GRAMPS Place ID values. The string is
697 expected to be in the form of a simple text string, or in a format
698 that contains a C/Python style format string using %d, such as P%d
699 or P%04d.
700 """
701 raise NotImplementedError
702
704 """
705 Set the naming template for GRAMPS Family ID values. The string is
706 expected to be in the form of a simple text string, or in a format
707 that contains a C/Python style format string using %d, such as F%d
708 or F%04d.
709 """
710 raise NotImplementedError
711
713 """
714 Set the naming template for GRAMPS Event ID values. The string is
715 expected to be in the form of a simple text string, or in a format
716 that contains a C/Python style format string using %d, such as E%d
717 or E%04d.
718 """
719 raise NotImplementedError
720
722 """
723 Set the naming template for GRAMPS Repository ID values. The string is
724 expected to be in the form of a simple text string, or in a format
725 that contains a C/Python style format string using %d, such as R%d
726 or R%04d.
727 """
728 raise NotImplementedError
729
731 """
732 Set the naming template for GRAMPS Note ID values. The string is
733 expected to be in the form of a simple text string, or in a format
734 that contains a C/Python style format string using %d, such as N%d
735 or N%04d.
736 """
737 raise NotImplementedError
738
740 """
741 Create a new Transaction tied to the current UNDO database. The
742 transaction has no effect until it is committed using the
743 transaction_commit function of the this database object.
744 """
745 raise NotImplementedError
746
748 """
749 Commits the transaction to the assocated UNDO database.
750 """
751 raise NotImplementedError
752
754 raise NotImplementedError
755
757 """
758 returns boolean of whether or not there's a possibility of undo
759 """
760 raise NotImplementedError
761
763 """
764 returns boolean of whether or not there's a possibility of redo
765 """
766 raise NotImplementedError
767
768 - def undo(self, update_history=True):
769 """
770 Accesses the last committed transaction, and reverts the data to
771 the state before the transaction was committed.
772 """
773 raise NotImplementedError
774
775 - def redo(self, update_history=True):
776 """
777 Accesses the last undone transaction, and reverts the data to
778 the state before the transaction was undone.
779 """
780 raise NotImplementedError
781
783 raise NotImplementedError
784
786 """
787 Defines the callback function that is called whenever an undo operation
788 is executed. The callback function recieves a single argument that is a
789 text string that defines the operation.
790 """
791 raise NotImplementedError
792
794 """
795 Defines the callback function that is called whenever an redo operation
796 is executed. The callback function recieves a single argument that is a
797 text string that defines the operation.
798 """
799 raise NotImplementedError
800
802 """
803 Return the list of locale-sorted surnames contained in the database.
804 """
805 raise NotImplementedError
806
808 """
809 Builds the list of locale-sorted surnames contained in the database.
810 The function must be overridden in the derived class.
811 """
812 raise NotImplementedError
813
815 raise NotImplementedError
816
818 """
819 Check whether there are persons with the same surname left in
820 the database. If not then we need to remove the name from the list.
821 The function must be overridden in the derived class.
822 """
823 raise NotImplementedError
824
826 """returns the list of Person handles in the bookmarks"""
827 raise NotImplementedError
828
830 """returns the list of Person handles in the bookmarks"""
831 raise NotImplementedError
832
834 """returns the list of Person handles in the bookmarks"""
835 raise NotImplementedError
836
838 """returns the list of Person handles in the bookmarks"""
839 raise NotImplementedError
840
842 """returns the list of Person handles in the bookmarks"""
843 raise NotImplementedError
844
848
850 """returns the list of Person handles in the bookmarks"""
851 raise NotImplementedError
852
854 """returns the list of Note handles in the bookmarks"""
855 raise NotImplementedError
856
858 """sets the information about the owner of the database"""
859 raise NotImplementedError
860
862 """returns the Researcher instance, providing information about
863 the owner of the database"""
864 raise NotImplementedError
865
867 """sets the default Person to the passed instance"""
868 raise NotImplementedError
869
871 """returns the default Person of the database"""
872 raise NotImplementedError
873
875 """returns the default Person of the database"""
876 raise NotImplementedError
877
879 """returns the save path of the file, or "" if one does not exist"""
880 raise NotImplementedError
881
883 """sets the save path for the database"""
884 raise NotImplementedError
885
887 """returns a list of all Event types assocated with Person
888 instances in the database"""
889 raise NotImplementedError
890
892 """returns a list of all Attribute types assocated with Person
893 instances in the database"""
894 raise NotImplementedError
895
897 """returns a list of all Attribute types assocated with Family
898 instances in the database"""
899 raise NotImplementedError
900
902 """returns a list of all Event types assocated with Family
903 instances in the database"""
904 raise NotImplementedError
905
907 """return a list of all marker types available in the database"""
908 raise NotImplementedError
909
914
916 """returns a list of all relationship types assocated with Family
917 instances in the database"""
918 raise NotImplementedError
919
921 """returns a list of all child reference types assocated with Family
922 instances in the database"""
923 raise NotImplementedError
924
926 """returns a list of all custom event role names assocated with Event
927 instances in the database"""
928 raise NotImplementedError
929
931 """returns a list of all custom names types assocated with Person
932 instances in the database"""
933 raise NotImplementedError
934
936 """returns a list of all custom repository types assocated with
937 Repository instances in the database"""
938 raise NotImplementedError
939
941 """returns a list of all custom note types assocated with
942 Note instances in the database"""
943 raise NotImplementedError
944
949
951 """returns a list of all custom names types assocated with Url
952 instances in the database"""
953 raise NotImplementedError
954
956 """
957 Remove the Person specified by the database handle from the
958 database, preserving the change in the passed transaction. This
959 method must be overridden in the derived class.
960 """
961 raise NotImplementedError
962
964 """
965 Remove the Source specified by the database handle from the
966 database, preserving the change in the passed transaction. This
967 method must be overridden in the derived class.
968 """
969 raise NotImplementedError
970
972 """
973 Remove the Event specified by the database handle from the
974 database, preserving the change in the passed transaction. This
975 method must be overridden in the derived class.
976 """
977 raise NotImplementedError
978
980 """
981 Remove the MediaObjectPerson specified by the database handle from the
982 database, preserving the change in the passed transaction. This
983 method must be overridden in the derived class.
984 """
985 raise NotImplementedError
986
988 """
989 Remove the Place specified by the database handle from the
990 database, preserving the change in the passed transaction. This
991 method must be overridden in the derived class.
992 """
993 raise NotImplementedError
994
996 """
997 Remove the Family specified by the database handle from the
998 database, preserving the change in the passed transaction. This
999 method must be overridden in the derived class.
1000 """
1001 raise NotImplementedError
1002
1004 """
1005 Remove the Repository specified by the database handle from the
1006 database, preserving the change in the passed transaction. This
1007 method must be overridden in the derived class.
1008 """
1009 raise NotImplementedError
1010
1012 """
1013 Remove the Note specified by the database handle from the
1014 database, preserving the change in the passed transaction. This
1015 method must be overridden in the derived class.
1016 """
1017 raise NotImplementedError
1018
1020 raise NotImplementedError
1021
1023 raise NotImplementedError
1024
1026 raise NotImplementedError
1027
1029 raise NotImplementedError
1030
1032 raise NotImplementedError
1033
1035 raise NotImplementedError
1036
1038 raise NotImplementedError
1039
1041 raise NotImplementedError
1042
1044 """
1045 returns True if the handle exists in the current Person database.
1046 """
1047 raise NotImplementedError
1048
1050 """
1051 returns True if the handle exists in the current Event database.
1052 """
1053 raise NotImplementedError
1054
1056 """
1057 returns True if the handle exists in the current Source database.
1058 """
1059 raise NotImplementedError
1060
1062 """
1063 returns True if the handle exists in the current Place database.
1064 """
1065 raise NotImplementedError
1066
1068 """
1069 returns True if the handle exists in the current Family database.
1070 """
1071 raise NotImplementedError
1072
1074 """
1075 returns True if the handle exists in the current MediaObjectdatabase.
1076 """
1077 raise NotImplementedError
1078
1080 """
1081 returns True if the handle exists in the current Repository database.
1082 """
1083 raise NotImplementedError
1084
1086 """
1087 returns True if the handle exists in the current Note database.
1088 """
1089 raise NotImplementedError
1090
1094
1098
1100 raise NotImplementedError
1101
1103 """
1104 Stores the Person display common information in the
1105 database's metadata.
1106 """
1107 raise NotImplementedError
1108
1110 """
1111 Stores the Person display common information in the
1112 database's metadata.
1113 """
1114 raise NotImplementedError
1115
1117 """
1118 Stores the Person display common information in the
1119 database's metadata.
1120 """
1121 raise NotImplementedError
1122
1124 """
1125 Stores the Place display common information in the
1126 database's metadata.
1127 """
1128 raise NotImplementedError
1129
1131 """
1132 Stores the Source display common information in the
1133 database's metadata.
1134 """
1135 raise NotImplementedError
1136
1143
1145 """
1146 Stores the Event display common information in the
1147 database's metadata.
1148 """
1149 raise NotImplementedError
1150
1152 """
1153 Stores the Repository display common information in the
1154 database's metadata.
1155 """
1156 raise NotImplementedError
1157
1159 """
1160 Stores the Note display common information in the
1161 database's metadata.
1162 """
1163 raise NotImplementedError
1164
1166 """
1167 Return the Person display common information stored in the
1168 database's metadata.
1169 """
1170 raise NotImplementedError
1171
1173 """
1174 Return the Person display common information stored in the
1175 database's metadata.
1176 """
1177 raise NotImplementedError
1178
1180 """
1181 Return the Person display common information stored in the
1182 database's metadata.
1183 """
1184 raise NotImplementedError
1185
1187 """
1188 Return the Place display common information stored in the
1189 database's metadata.
1190 """
1191 raise NotImplementedError
1192
1194 """
1195 Return the Source display common information stored in the
1196 database's metadata.
1197 """
1198 raise NotImplementedError
1199
1206
1208 """
1209 Return the Event display common information stored in the
1210 database's metadata.
1211 """
1212 raise NotImplementedError
1213
1215 """
1216 Return the Repository display common information stored in the
1217 database's metadata.
1218 """
1219 raise NotImplementedError
1220
1222 """
1223 Return the Note display common information stored in the
1224 database's metadata.
1225 """
1226 raise NotImplementedError
1227
1229 """Called each time an object is removed from the database. This can
1230 be used by subclasses to update any additional index tables that might
1231 need to be changed."""
1232 raise NotImplementedError
1233
1235 """Called each time an object is writen to the database. This can
1236 be used by subclasses to update any additional index tables that might
1237 need to be changed."""
1238 raise NotImplementedError
1239
1241 """
1242 Reindex all primary records in the database.
1243
1244 """
1245 raise NotImplementedError
1246
1248 """
1249 Find all objects that hold a reference to the object handle.
1250 Returns an interator over alist of (class_name, handle) tuples.
1251
1252 @param handle: handle of the object to search for.
1253 @type handle: database handle
1254 @param include_classes: list of class names to include in the results.
1255 Default: None means include all classes.
1256 @type include_classes: list of class names
1257
1258 This default implementation does a sequencial scan through all
1259 the primary object databases and is very slow. Backends can
1260 override this method to provide much faster implementations that
1261 make use of additional capabilities of the backend.
1262
1263 Note that this is a generator function, it returns a iterator for
1264 use in loops. If you want a list of the results use:
1265
1266 > result_list = [i for i in find_backlink_handles(handle)]
1267 """
1268
1269 raise NotImplementedError
1270