From 576b6a3f7fd6abed68a35ae51975763346a28b28 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Mon, 5 Jan 2004 20:39:09 +0000 Subject: [PATCH] * src/plugins/ReadGedcom.py: More source parsing cleanups. svn: r2588 --- ChangeLog | 3 +++ src/plugins/ReadGedcom.py | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 393280f56..b5a7b3e48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2004-01-05 Alex Roitman + * src/plugins/ReadGedcom.py: More source parsing cleanups. + 2004-01-04 Alex Roitman * src/plugins/ReadGedcom.py: Correct level in parsing LDS ordinance source references. Support for source description-type references. diff --git a/src/plugins/ReadGedcom.py b/src/plugins/ReadGedcom.py index fb0e05823..9d2126bed 100644 --- a/src/plugins/ReadGedcom.py +++ b/src/plugins/ReadGedcom.py @@ -259,7 +259,6 @@ class GedcomParser: self.update(self.file_obj,os.path.basename(file)) self.search_paths = [] - self.source_description="" try: mypaths = [] @@ -465,6 +464,7 @@ class GedcomParser: elif matches[1] == "NOTE": note = self.parse_note(matches,self.source,level+1,note) elif matches[1] == "TEXT": + note = self.source.getNote() d = self.parse_continue_data(level+1) if note: note = "%s\n%s %s%s" % (note,matches[1],matches[2],d) @@ -473,6 +473,7 @@ class GedcomParser: elif matches[1] == "ABBR": self.source.setAbbrev(matches[2] + self.parse_continue_data(level+1)) else: + note = self.source.getNote() if note: note = "%s\n%s %s" % (note,matches[1],matches[2]) else: @@ -547,7 +548,7 @@ class GedcomParser: self.backup() return elif matches[1] == "SOUR": - event.addSourceRef(self.handle_source(matches,level)) + event.addSourceRef(self.handle_source(matches,level+1)) else: self.barf(1) @@ -904,7 +905,7 @@ class GedcomParser: elif matches[1] == "PEDI": type = matches[2] elif matches[1] == "SOUR": - source_ref = self.handle_source(matches,level) + source_ref = self.handle_source(matches,level+1) self.person.getPrimaryName().addSourceRef(source_ref) elif matches[1] == "_PRIMARY": type = matches[1] @@ -1211,7 +1212,7 @@ class GedcomParser: elif matches[1] in ["TIME","ADDR","AGE","AGNC","STAT","TEMP","OBJE"]: self.ignore_sub_junk(level+1) elif matches[1] == "SOUR": - event.addSourceRef(self.handle_source(matches,level)) + event.addSourceRef(self.handle_source(matches,level+1)) elif matches[1] == "FAMC": family = self.db.findFamily(matches[2],self.fmap) mrel,frel = self.parse_adopt_famc(level+1); @@ -1291,7 +1292,7 @@ class GedcomParser: elif matches[1] in ["CAUS", "DATE","TIME","ADDR","AGE","AGNC","STAT","TEMP","OBJE"]: self.ignore_sub_junk(level+1) elif matches[1] == "SOUR": - attr.addSourceRef(self.handle_source(matches,level)) + attr.addSourceRef(self.handle_source(matches,level+1)) elif matches[1] == "PLAC": val = matches[2] if attr.getValue() == "": @@ -1723,7 +1724,6 @@ class GedcomParser: self.ignore_sub_junk(level+1) else: source_ref.setBase(self.db.findSource(matches[2],self.smap)) - self.source_description = matches[2] self.parse_source_reference(source_ref,level) return source_ref