Fixed read/write gedcom bugs

svn: r680
This commit is contained in:
Don Allingham
2002-01-06 04:02:50 +00:00
parent db449a4968
commit c79c5bfda0
3 changed files with 26 additions and 4 deletions
+15 -1
View File
@@ -662,7 +662,21 @@ class GedcomParser:
self.person.addAttribute(attr)
else:
self.person.addEvent(event)
elif matches[1] in ["AFN","CHAN","REFN","SOUR","ASSO"]:
elif matches[1] == "SOUR":
source_ref = SourceRef()
if matches[2] and matches[2][0] != "@":
self.localref = self.localref + 1
ref = "gsr%d" % self.localref
s = self.db.findSource(ref,self.smap)
source_ref.setBase(s)
s.setTitle('Imported Source #%d' % self.localref)
s.setNote(matches[2] + self.parse_continue_data(2))
self.ignore_sub_junk(2)
else:
source_ref.setBase(self.db.findSource(matches[2],self.smap))
self.parse_source_reference(source_ref,2)
self.person.getPrimaryName().addSourceRef(source_ref)
elif matches[1] in ["AFN","CHAN","REFN","ASSO"]:
self.ignore_sub_junk(2)
elif matches[1] in ["ANCI","DESI","RIN","RFN"]:
pass
+5 -2
View File
@@ -207,6 +207,7 @@ def add_persons_sources(person,slist,private):
sbase = source_ref.getBase()
if sbase != None and sbase not in slist:
slist.append(sbase)
for event in person.getAddressList():
if private and event.getPrivacy():
continue
@@ -214,14 +215,16 @@ def add_persons_sources(person,slist,private):
sbase = source_ref.getBase()
if sbase != None and sbase not in slist:
slist.append(sbase)
for event in person.getAttibuteList:
for event in person.getAttibuteList():
if private and event.getPrivacy():
continue
for source_ref in event.getSourceRefList():
sbase = source_ref.getBase()
if sbase != None and sbase not in slist:
slist.append(sbase)
for name in person.getNameList + [person.getPrimaryName()]:
for name in person.getNameList() + [person.getPrimaryName()]:
if private and name.getPrivacy():
continue
for source_ref in name.getSourceRefList():