From 53863807a064b2930a0b99d6e122d2b132c5b89b Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 16 Dec 2006 22:36:32 +0000 Subject: [PATCH] 2006-12-16 Don Allingham * src/GrampsDb/_ReadGedcom.py: proper handling of unknown source tags svn: r7810 --- ChangeLog | 3 +++ src/GrampsDb/_ReadGedcom.py | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d196db349..826367e4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2006-12-16 Don Allingham + * src/GrampsDb/_ReadGedcom.py: proper handling of unknown source tags (bug #654) + 2006-12-15 Don Allingham * src/GrampsWidgets.py (PlaceEntry.set_button): fix tooltips (bug #764) * src/glade/gramps.glade: remove static tooltip diff --git a/src/GrampsDb/_ReadGedcom.py b/src/GrampsDb/_ReadGedcom.py index 76e11a1c8..abad47da5 100644 --- a/src/GrampsDb/_ReadGedcom.py +++ b/src/GrampsDb/_ReadGedcom.py @@ -941,7 +941,7 @@ class GedcomParser(UpdateCallback): self.db.commit_source(self.source, self.trans) def func_source_undef(self, matches, source, level): - self.not_recognized(level) + self.not_recognized(level+1) def func_source_ignore(self, matches, source, level): self.ignore_sub_junk(level+1) @@ -1412,6 +1412,13 @@ class GedcomParser(UpdateCallback): (form, filename, title, note) = self.parse_obje(level) self.build_media_object(event, form, filename, title, note) + def func_place_object(self, matches, place, level): + if matches[2] and matches[2][0] == '@': + self.not_recognized(level) + else: + (form, filename, title, note) = self.parse_obje(level) + self.build_media_object(place, form, filename, title, note) + def func_source_object(self, matches, source, level): if matches[2] and matches[2][0] == '@': self.not_recognized(level) @@ -1758,7 +1765,6 @@ class GedcomParser(UpdateCallback): while True: matches = self.get_next() - if self.level_is_finished(matches,level): break elif matches[1] in (TOKEN_ADDR, TOKEN_ADR1, TOKEN_ADR2): @@ -1963,6 +1969,7 @@ class GedcomParser(UpdateCallback): +1 <> {0:M} +1 <> {0:M} """ + val = matches[2] n = event.get_type() if self.is_ftw and int(n) in [RelLib.EventType.OCCUPATION, @@ -1982,10 +1989,11 @@ class GedcomParser(UpdateCallback): elif matches[1] == TOKEN_NOTE: note = self.parse_note(matches, place, level+1, '') place.set_note(note) + elif matches[1] == TOKEN_OBJE: + self.func_place_object(matches, place, level+1) elif matches[1] == TOKEN_SOUR: place.add_source_reference( self.handle_source(matches,level+1)) - self.db.commit_place(place, self.trans) def func_event_cause(self, matches, event_ref, event, level):