* src/plugins/ReadGedcom.py: More source parsing cleanups.
svn: r2588
This commit is contained in:
parent
7bb94c7b3a
commit
576b6a3f7f
@ -1,3 +1,6 @@
|
|||||||
|
2004-01-05 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
|
* src/plugins/ReadGedcom.py: More source parsing cleanups.
|
||||||
|
|
||||||
2004-01-04 Alex Roitman <shura@alex.neuro.umn.edu>
|
2004-01-04 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
* src/plugins/ReadGedcom.py: Correct level in parsing LDS ordinance
|
* src/plugins/ReadGedcom.py: Correct level in parsing LDS ordinance
|
||||||
source references. Support for source description-type references.
|
source references. Support for source description-type references.
|
||||||
|
@ -259,7 +259,6 @@ class GedcomParser:
|
|||||||
self.update(self.file_obj,os.path.basename(file))
|
self.update(self.file_obj,os.path.basename(file))
|
||||||
|
|
||||||
self.search_paths = []
|
self.search_paths = []
|
||||||
self.source_description=""
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mypaths = []
|
mypaths = []
|
||||||
@ -465,6 +464,7 @@ class GedcomParser:
|
|||||||
elif matches[1] == "NOTE":
|
elif matches[1] == "NOTE":
|
||||||
note = self.parse_note(matches,self.source,level+1,note)
|
note = self.parse_note(matches,self.source,level+1,note)
|
||||||
elif matches[1] == "TEXT":
|
elif matches[1] == "TEXT":
|
||||||
|
note = self.source.getNote()
|
||||||
d = self.parse_continue_data(level+1)
|
d = self.parse_continue_data(level+1)
|
||||||
if note:
|
if note:
|
||||||
note = "%s\n%s %s%s" % (note,matches[1],matches[2],d)
|
note = "%s\n%s %s%s" % (note,matches[1],matches[2],d)
|
||||||
@ -473,6 +473,7 @@ class GedcomParser:
|
|||||||
elif matches[1] == "ABBR":
|
elif matches[1] == "ABBR":
|
||||||
self.source.setAbbrev(matches[2] + self.parse_continue_data(level+1))
|
self.source.setAbbrev(matches[2] + self.parse_continue_data(level+1))
|
||||||
else:
|
else:
|
||||||
|
note = self.source.getNote()
|
||||||
if note:
|
if note:
|
||||||
note = "%s\n%s %s" % (note,matches[1],matches[2])
|
note = "%s\n%s %s" % (note,matches[1],matches[2])
|
||||||
else:
|
else:
|
||||||
@ -547,7 +548,7 @@ class GedcomParser:
|
|||||||
self.backup()
|
self.backup()
|
||||||
return
|
return
|
||||||
elif matches[1] == "SOUR":
|
elif matches[1] == "SOUR":
|
||||||
event.addSourceRef(self.handle_source(matches,level))
|
event.addSourceRef(self.handle_source(matches,level+1))
|
||||||
else:
|
else:
|
||||||
self.barf(1)
|
self.barf(1)
|
||||||
|
|
||||||
@ -904,7 +905,7 @@ class GedcomParser:
|
|||||||
elif matches[1] == "PEDI":
|
elif matches[1] == "PEDI":
|
||||||
type = matches[2]
|
type = matches[2]
|
||||||
elif matches[1] == "SOUR":
|
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)
|
self.person.getPrimaryName().addSourceRef(source_ref)
|
||||||
elif matches[1] == "_PRIMARY":
|
elif matches[1] == "_PRIMARY":
|
||||||
type = matches[1]
|
type = matches[1]
|
||||||
@ -1211,7 +1212,7 @@ class GedcomParser:
|
|||||||
elif matches[1] in ["TIME","ADDR","AGE","AGNC","STAT","TEMP","OBJE"]:
|
elif matches[1] in ["TIME","ADDR","AGE","AGNC","STAT","TEMP","OBJE"]:
|
||||||
self.ignore_sub_junk(level+1)
|
self.ignore_sub_junk(level+1)
|
||||||
elif matches[1] == "SOUR":
|
elif matches[1] == "SOUR":
|
||||||
event.addSourceRef(self.handle_source(matches,level))
|
event.addSourceRef(self.handle_source(matches,level+1))
|
||||||
elif matches[1] == "FAMC":
|
elif matches[1] == "FAMC":
|
||||||
family = self.db.findFamily(matches[2],self.fmap)
|
family = self.db.findFamily(matches[2],self.fmap)
|
||||||
mrel,frel = self.parse_adopt_famc(level+1);
|
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"]:
|
elif matches[1] in ["CAUS", "DATE","TIME","ADDR","AGE","AGNC","STAT","TEMP","OBJE"]:
|
||||||
self.ignore_sub_junk(level+1)
|
self.ignore_sub_junk(level+1)
|
||||||
elif matches[1] == "SOUR":
|
elif matches[1] == "SOUR":
|
||||||
attr.addSourceRef(self.handle_source(matches,level))
|
attr.addSourceRef(self.handle_source(matches,level+1))
|
||||||
elif matches[1] == "PLAC":
|
elif matches[1] == "PLAC":
|
||||||
val = matches[2]
|
val = matches[2]
|
||||||
if attr.getValue() == "":
|
if attr.getValue() == "":
|
||||||
@ -1723,7 +1724,6 @@ class GedcomParser:
|
|||||||
self.ignore_sub_junk(level+1)
|
self.ignore_sub_junk(level+1)
|
||||||
else:
|
else:
|
||||||
source_ref.setBase(self.db.findSource(matches[2],self.smap))
|
source_ref.setBase(self.db.findSource(matches[2],self.smap))
|
||||||
self.source_description = matches[2]
|
|
||||||
self.parse_source_reference(source_ref,level)
|
self.parse_source_reference(source_ref,level)
|
||||||
return source_ref
|
return source_ref
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user