From 19f4c3ab91512d885d40150fa80aa15a71c00577 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 26 Feb 2007 23:12:29 +0000 Subject: [PATCH] 2007-02-26 Don Allingham * src/GrampsDbUtils/_GedcomParse.py: handle EVENTS with argument on the declaration line * src/GrampsDbUtils/_GedcomLex.py: handle EVENTS with argument on the declaration line svn: r8251 --- ChangeLog | 6 ++++++ src/GrampsDbUtils/_GedcomLex.py | 5 ++++- src/GrampsDbUtils/_GedcomParse.py | 11 +++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6580e6e6..f54c97ed8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-02-26 Don Allingham + * src/GrampsDbUtils/_GedcomParse.py: handle EVENTS with argument on + the declaration line + * src/GrampsDbUtils/_GedcomLex.py: handle EVENTS with argument on + the declaration line + 2007-02-26 Martin Hawlisch * src/RelLib/_AttributeType.py: Add WITNESS (used by GEDCOM parser to import textual event witness information diff --git a/src/GrampsDbUtils/_GedcomLex.py b/src/GrampsDbUtils/_GedcomLex.py index dc7a75d51..fb3eaf45d 100644 --- a/src/GrampsDbUtils/_GedcomLex.py +++ b/src/GrampsDbUtils/_GedcomLex.py @@ -179,8 +179,11 @@ class GedLine: """ token = GED2GRAMPS.get(self.token_text) if token: + event = RelLib.Event() + event.set_description(self.data) + event.set_type(token) self.token = TOKEN_GEVENT - self.data = token + self.data = event else: token = GED2ATTR.get(self.token_text) if token: diff --git a/src/GrampsDbUtils/_GedcomParse.py b/src/GrampsDbUtils/_GedcomParse.py index 8ab652744..09bee5bf0 100644 --- a/src/GrampsDbUtils/_GedcomParse.py +++ b/src/GrampsDbUtils/_GedcomParse.py @@ -1460,10 +1460,10 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - event = RelLib.Event() + + event = line.data + event.set_gramps_id(self.emapper.find_next()) event_ref = RelLib.EventRef() - event.set_gramps_id(self.emapper.find_next()) - event.set_type(line.data) self.dbase.add_event(event, self.trans) sub_state = GedcomUtils.CurrentState() @@ -2436,11 +2436,10 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - event = RelLib.Event() + event = line.data + event.set_gramps_id(self.emapper.find_next()) event_ref = RelLib.EventRef() event_ref.set_role(RelLib.EventRoleType.FAMILY) - event.set_gramps_id(self.emapper.find_next()) - event.set_type(line.data) self.dbase.add_event(event, self.trans) sub_state = GedcomUtils.CurrentState()