diff --git a/data/tests/imp_FTM_LINK.ged b/data/tests/imp_FTM_LINK.ged new file mode 100644 index 000000000..c05b35378 --- /dev/null +++ b/data/tests/imp_FTM_LINK.ged @@ -0,0 +1,41 @@ +0 HEAD +1 SOUR FTM +2 VERS Family Tree Maker (22.0.0.1410) +2 NAME Family Tree Maker for Windows +2 CORP Ancestry.com +3 ADDR 360 W 4800 N +4 CONT Provo, UT 84604 +3 PHON (801) 705-7000 +1 DEST GED55 +1 DATE 01 MAR 2016 +1 CHAR UTF-8 +1 FILE D:\Family Tree Maker\imp_FTM_LINK.ged +1 SUBM @SUBM@ +1 GEDC +2 VERS 5.5 +2 FORM LINEAGE-LINKED +0 @SUBM@ SUBM +0 @I937@ INDI +1 NAME François Joseph /Raffath/ +2 SOUR @S241@ +3 _LINK http://gw.geneanet.org/danynogue2?lang=en&pz=anny+lise+marie&nz=le+vaillant&ocz=0&p=francois+joseph&n=raffath&oc=6 +0 @I1@ INDI +1 NAME Michael /Sullivan/ +2 SOUR @S118@ +3 PAGE GS Film number: 2342492 Frame Number: Digital Folder Number: +4 CONC 4208243 Image Number: 339 Reference ID: p 493 rn 9850 +3 DATA +4 TEXT Name: Michael Sullivan Race (Original): Age (Expanded): 25 years +5 CONC Birth Year: 1866 Birthplace: Ireland Spouse's Name: Nellie +5 CONC Moynahan Spouse's Race (Original): Spouse's Age +5 CONC (Expanded): 25 years Spouse's Birth Year: 1866 Spouse's +5 CONC Birthplace: Ireland Event Date: 04 Nov 1891 Event Place: Wayne, +5 CONC Michigan Father's Name: Michael Sullivan Mother's Name: +5 CONC Julia Brosnahan Spouse's Father's Name: Mich. Moynahan +5 CONC Spouse's Mother's Name: Ellen Quinlan +3 _LINK https://familysearch.org/pal:/MM9.1.1/N3XS-1BL +0 @S118@ SOUR +1 TITL Michigan, Marriages, 1868-1925 +0 @S241@ SOUR +1 TITL Daniel NOGUE family tree +0 TRLR diff --git a/data/tests/imp_FTM_LINK.gramps b/data/tests/imp_FTM_LINK.gramps new file mode 100644 index 000000000..429941a09 --- /dev/null +++ b/data/tests/imp_FTM_LINK.gramps @@ -0,0 +1,67 @@ + + + +
+ + + +
+ + + U + + François Joseph + Raffath + + + + + U + + Michael + Sullivan + + + + + + + 2 + + + + + GS Film number: 2342492 Frame Number: Digital Folder Number: 4208243 Image Number: 339 Reference ID: p 493 rn 9850 + 2 + + + + + + + + Daniel NOGUE family tree + + + Michigan, Marriages, 1868-1925 + + + + + http://gw.geneanet.org/danynogue2?lang=en&pz=anny+lise+marie&nz=le+vaillant&ocz=0&p=francois+joseph&n=raffath&oc=6 + + + + Name: Michael Sullivan Race (Original): Age (Expanded): 25 years Birth Year: 1866 Birthplace: Ireland Spouse's Name: Nellie Moynahan Spouse's Race (Original): Spouse's Age (Expanded): 25 years Spouse's Birth Year: 1866 Spouse's Birthplace: Ireland Event Date: 04 Nov 1891 Event Place: Wayne, Michigan Father's Name: Michael Sullivan Mother's Name: Julia Brosnahan Spouse's Father's Name: Mich. Moynahan Spouse's Mother's Name: Ellen Quinlan + + + https://familysearch.org/pal:/MM9.1.1/N3XS-1BL + + + +
diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index 2bc6007aa..019b5ed56 100755 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -268,6 +268,7 @@ TOKEN__MARN = 129 TOKEN__ADPN = 130 TOKEN__FSFTID = 131 TOKEN__PHOTO = 132 +TOKEN__LINK = 133 TOKENS = { "HEAD" : TOKEN_HEAD, "MEDI" : TOKEN_MEDI, @@ -374,7 +375,7 @@ TOKENS = { "_URL" : TOKEN_URL, "URL" : TOKEN_URL, "_MAR" : TOKEN__MAR, "_MARN" : TOKEN__MARN, "_ADPN" : TOKEN__ADPN, "_FSFTID" : TOKEN__FSFTID, - "_PHOTO" : TOKEN__PHOTO, + "_LINK" : TOKEN__LINK, "_PHOTO" : TOKEN__PHOTO, } ADOPT_NONE = 0 @@ -2313,6 +2314,7 @@ class GedcomParser(UpdateCallback): TOKEN_NOTE : self.__citation_note, TOKEN_RNOTE : self.__citation_note, TOKEN_TEXT : self.__citation_data_text, + TOKEN__LINK : self.__citation_link, } self.func_list.append(self.citation_parse_tbl) @@ -6170,6 +6172,22 @@ class GedcomParser(UpdateCallback): state.citation.add_note(note.get_handle()) + def __citation_link(self, line, state): + """ + Not legal GEDCOM - added to support FTM, converts the _LINK tag to a + note with styled text so link can be followed in reports etc. + """ + note = Note() + tags = StyledTextTag(StyledTextTagType.LINK, + line.data, + [(0, len(line.data))]) + note.set_styledtext(StyledText(line.data, [tags])) + gramps_id = self.dbase.find_next_note_gramps_id() + note.set_gramps_id(gramps_id) + note.set_type(NoteType.CITATION) + self.dbase.add_note(note, self.trans) + state.citation.add_note(note.get_handle()) + def __citation_data_note(self, line, state): self.__parse_note(line, state.citation, state.level, state)