diff --git a/ChangeLog b/ChangeLog index 9c09aef68..b4dceca31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-12-06 Jim Sack + * src/GrampsDbUtils/_GedcomParse.py : #1418 fix read ASSO + * src/GrampsDbUtils/_WriteGedcom.py : #1418 fix write ASSO + read was looking for TYPE, write was emitting TYPE, but + TYPE evidently was only part of a draft (or earlier) spec + Current spec allows ASSO to link only to INDI + 2007-12-06 Douglas S.Blank * src/plugins/CalculateEstimatedDates.py: pass in handle to link * src/PluginUtils/_PluginWindows.py: New clickable text tests diff --git a/src/GrampsDbUtils/_GedcomParse.py b/src/GrampsDbUtils/_GedcomParse.py index 9792d3295..904dbc4a4 100644 --- a/src/GrampsDbUtils/_GedcomParse.py +++ b/src/GrampsDbUtils/_GedcomParse.py @@ -553,7 +553,6 @@ class GedcomParser(UpdateCallback): } self.asso_parse_tbl = { - TOKEN_TYPE : self.__person_asso_type, TOKEN_RELA : self.__person_asso_rela, TOKEN_SOUR : self.__person_asso_sour, TOKEN_NOTE : self.__person_asso_note, @@ -2291,13 +2290,12 @@ class GedcomParser(UpdateCallback): And the the sub tags are: ASSOCIATION_STRUCTURE:= - +1 TYPE {1:1} +1 RELA {1:1} +1 <> {0:M} +1 <> {0:M} - GRAMPS only supports ASSO records to people, so if the TYPE is - something other than INDI, the record is ignored. + The Gedcom spec notes that the ASSOCIATION_STRUCTURE + can only link to an INDIVIDUAL_RECORD @param line: The current line in GedLine format @type line: GedLine @@ -2322,20 +2320,6 @@ class GedcomParser(UpdateCallback): if not sub_state.ignore: state.person.add_person_ref(sub_state.ref) - def __person_asso_type(self, line, state): - """ - Parses the INDI.ASSO.TYPE tag. GRAMPS only supports the ASSO tag when - the tag represents an INDI. So if the data is not INDI, we set the - ignore flag, so that we ignore the record. - - @param line: The current line in GedLine format - @type line: GedLine - @param state: The current state - @type state: CurrentState - """ - if line.data != "INDI": - state.ignore = True - def __person_asso_rela(self, line, state): """ Parses the INDI.ASSO.RELA tag. diff --git a/src/GrampsDbUtils/_WriteGedcom.py b/src/GrampsDbUtils/_WriteGedcom.py index 1f311bf25..faa6a4c39 100644 --- a/src/GrampsDbUtils/_WriteGedcom.py +++ b/src/GrampsDbUtils/_WriteGedcom.py @@ -537,7 +537,6 @@ class GedcomWriter(BasicUtils.UpdateCallback): def __assoc(self, person, level): """ n ASSO @@ {0:M} - +1 TYPE {1:1} +1 RELA {1:1} +1 <> {0:M} +1 <> {0:M} @@ -545,7 +544,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): for ref in person.get_person_ref_list(): person = self.dbase.get_person_from_handle(ref.ref) self.__writeln(level, "ASSO", "@%s@" % person.get_gramps_id()) - self.__writeln(level+1, "TYPE", ref.get_relation()) + self.__writeln(level+1, "RELA", ref.get_relation()) self.__note_references(ref.get_note_list(), level+1) self.__source_references(ref.get_source_references(), level+1)