From 3ca02c31efa49b103a23e65f27bfb4b674cbd609 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 4 Dec 2006 15:50:45 +0000 Subject: [PATCH] 2006-12-04 Don Allingham * src/GrampsDb/_ReadGedcom.py: Handle notes with the way that Legacy can produce Place/Address combinations svn: r7757 --- ChangeLog | 4 ++++ src/GrampsDb/_ReadGedcom.py | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4b8c894a8..9bd046b43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-12-04 Don Allingham + * src/GrampsDb/_ReadGedcom.py: Handle notes with the way that + Legacy can produce Place/Address combinations + 2006-12-03 Don Allingham * src/DataViews/_RelationView.py: improve tooltips * src/GrampsWidgets.py: tooltip support diff --git a/src/GrampsDb/_ReadGedcom.py b/src/GrampsDb/_ReadGedcom.py index cdd39bda5..e84c2b21d 100644 --- a/src/GrampsDb/_ReadGedcom.py +++ b/src/GrampsDb/_ReadGedcom.py @@ -1522,6 +1522,16 @@ class GedcomParser(UpdateCallback): note = new_note task(note) return note + + def parse_note_simple(self, matches, level): + # reference to a named note defined elsewhere + if matches[2] and matches[2][0] == "@": + note_obj = self.note_map.get(matches[2]) + note = note_obj.get() + else: + note = matches[2] + self.ignore_sub_junk(level+1) + return note def parse_note(self,matches,obj,level,old_note): return self.parse_note_base(matches,obj,level,old_note,obj.set_note) @@ -1772,7 +1782,7 @@ class GedcomParser(UpdateCallback): location.set_country(matches[2]) added = True elif matches[1] == TOKEN_NOTE: - note = self.parse_note(matches,location,level+1,'') + note = self.parse_note_simple(matches, level+1) added = True elif matches[1] in (TOKEN__LOC, TOKEN__NAME, TOKEN_PHON): pass # ignore unsupported extended location syntax