From 38826b69462c7df9bb0cd3898478416589ad6e6f Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Mon, 30 Dec 2013 11:03:28 +0200 Subject: [PATCH] 6380: GEDCOM export error for family _UID Port gramps34 [429c18] Applying patch from 2013-12-24 by Enno Borgsteede, fixing attribute processing on the path that handled _UID and adding another extension, _FSFTID. --- gramps/plugins/export/exportgedcom.py | 9 +++++---- gramps/plugins/lib/libgedcom.py | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gramps/plugins/export/exportgedcom.py b/gramps/plugins/export/exportgedcom.py index 9cb5918f8..70cc8f289 100644 --- a/gramps/plugins/export/exportgedcom.py +++ b/gramps/plugins/export/exportgedcom.py @@ -631,7 +631,7 @@ class GedcomWriter(UpdateCallback): key = str(attr.get_type()) value = attr.get_value().strip().replace('\r', ' ') - if key in ("AFN", "RFN", "REFN", "_UID"): + if key in ("AFN", "RFN", "REFN", "_UID", "_FSFTID"): self._writeln(1, key, value) continue @@ -878,10 +878,11 @@ class GedcomWriter(UpdateCallback): attr_type = int(attr.get_type()) name = libgedcom.FAMILYCONSTANTATTRIBUTES.get(attr_type) + key = str(attr.get_type()) value = attr.get_value().replace('\r', ' ') - if attr_type in ("AFN", "RFN", "REFN", "_UID"): - self._writeln(1, attr_type, value) + if key in ("AFN", "RFN", "REFN", "_UID"): + self._writeln(1, key, value) continue if name and name.strip(): @@ -889,7 +890,7 @@ class GedcomWriter(UpdateCallback): continue else: self._writeln(1, 'FACT', value) - self._writeln(2, 'TYPE', str(attr.get_type())) + self._writeln(2, 'TYPE', key) self._note_references(attr.get_note_list(), level+1) self._source_references(attr.get_citation_list(), diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index 18cdcb2b8..62fa2ff6d 100644 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -275,6 +275,7 @@ TOKEN_ROLE = 127 TOKEN__MAR = 128 TOKEN__MARN = 129 TOKEN__ADPN = 130 +TOKEN__FSFTID = 131 TOKENS = { "HEAD" : TOKEN_HEAD, "MEDI" : TOKEN_MEDI, @@ -380,7 +381,7 @@ TOKENS = { "EMAI" : TOKEN_EMAIL, "WWW" : TOKEN_WWW, "_URL" : TOKEN_URL, "URL" : TOKEN_URL, "_MAR" : TOKEN__MAR, "_MARN" : TOKEN__MARN, - "_ADPN" : TOKEN__ADPN + "_ADPN" : TOKEN__ADPN, "_FSFTID" : TOKEN__FSFTID, } ADOPT_NONE = 0 @@ -1008,6 +1009,7 @@ _MAP_DATA = { TOKEN__STAT : GedLine.calc_attr, TOKEN__UID : GedLine.calc_attr, TOKEN_AFN : GedLine.calc_attr, + TOKEN__FSFTID : GedLine.calc_attr, } #-------------------------------------------------------------------------