6380: GEDCOM export error for family _UID

Applying patch from 2013-12-24 by Enno Borgsteede,
fixing attribute processing on the path that handled _UID
and adding another extension, _FSFTID.
This commit is contained in:
Vassilii Khachaturov 2013-12-30 10:42:01 +02:00
parent eb44633c42
commit 429c18af6a
2 changed files with 8 additions and 5 deletions

View File

@ -634,7 +634,7 @@ class GedcomWriter(UpdateCallback):
key = str(attr.get_type()) key = str(attr.get_type())
value = attr.get_value().strip().replace('\r', ' ') 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) self.__writeln(1, key, value)
continue continue
@ -876,10 +876,11 @@ class GedcomWriter(UpdateCallback):
attr_type = int(attr.get_type()) attr_type = int(attr.get_type())
name = libgedcom.FAMILYCONSTANTATTRIBUTES.get(attr_type) name = libgedcom.FAMILYCONSTANTATTRIBUTES.get(attr_type)
key = str(attr.get_type())
value = attr.get_value().replace('\r', ' ') value = attr.get_value().replace('\r', ' ')
if attr_type in ("AFN", "RFN", "REFN", "_UID"): if key in ("AFN", "RFN", "REFN", "_UID"):
self.__writeln(1, attr_type, value) self.__writeln(1, key, value)
continue continue
if name and name.strip(): if name and name.strip():
@ -887,7 +888,7 @@ class GedcomWriter(UpdateCallback):
continue continue
else: else:
self.__writeln(1, 'FACT', value) 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.__note_references(attr.get_note_list(), level+1)
self.__source_references(attr.get_citation_list(), self.__source_references(attr.get_citation_list(),

View File

@ -258,6 +258,7 @@ TOKEN_ROLE = 127
TOKEN__MAR = 128 TOKEN__MAR = 128
TOKEN__MARN = 129 TOKEN__MARN = 129
TOKEN__ADPN = 130 TOKEN__ADPN = 130
TOKEN__FSFTID = 131
TOKENS = { TOKENS = {
"HEAD" : TOKEN_HEAD, "MEDI" : TOKEN_MEDI, "HEAD" : TOKEN_HEAD, "MEDI" : TOKEN_MEDI,
@ -363,7 +364,7 @@ TOKENS = {
"EMAI" : TOKEN_EMAIL, "WWW" : TOKEN_WWW, "EMAI" : TOKEN_EMAIL, "WWW" : TOKEN_WWW,
"_URL" : TOKEN_URL, "URL" : TOKEN_URL, "_URL" : TOKEN_URL, "URL" : TOKEN_URL,
"_MAR" : TOKEN__MAR, "_MARN" : TOKEN__MARN, "_MAR" : TOKEN__MAR, "_MARN" : TOKEN__MARN,
"_ADPN" : TOKEN__ADPN "_ADPN" : TOKEN__ADPN, "_FSFTID" : TOKEN__FSFTID,
} }
ADOPT_NONE = 0 ADOPT_NONE = 0
@ -991,6 +992,7 @@ _MAP_DATA = {
TOKEN__STAT : GedLine.calc_attr, TOKEN__STAT : GedLine.calc_attr,
TOKEN__UID : GedLine.calc_attr, TOKEN__UID : GedLine.calc_attr,
TOKEN_AFN : GedLine.calc_attr, TOKEN_AFN : GedLine.calc_attr,
TOKEN__FSFTID : GedLine.calc_attr,
} }
#------------------------------------------------------------------------- #-------------------------------------------------------------------------