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

View File

@ -114,7 +114,12 @@ class Find:
last = self.clist.rows last = self.clist.rows
person = None person = None
while row != orow: while row != orow:
person,alt = self.clist.get_row_data(row) value = self.clist.get_row_data(row)
if value == None:
row = row - 1
continue
person = value[0]
alt = value[1]
if alt == 0: if alt == 0:
name = person.getPrimaryName().getName() name = person.getPrimaryName().getName()
if string.find(string.upper(name),string.upper(text)) >= 0: if string.find(string.upper(name),string.upper(text)) >= 0:

View File

@ -662,7 +662,21 @@ class GedcomParser:
self.person.addAttribute(attr) self.person.addAttribute(attr)
else: else:
self.person.addEvent(event) 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) self.ignore_sub_junk(2)
elif matches[1] in ["ANCI","DESI","RIN","RFN"]: elif matches[1] in ["ANCI","DESI","RIN","RFN"]:
pass pass

View File

@ -207,6 +207,7 @@ def add_persons_sources(person,slist,private):
sbase = source_ref.getBase() sbase = source_ref.getBase()
if sbase != None and sbase not in slist: if sbase != None and sbase not in slist:
slist.append(sbase) slist.append(sbase)
for event in person.getAddressList(): for event in person.getAddressList():
if private and event.getPrivacy(): if private and event.getPrivacy():
continue continue
@ -214,14 +215,16 @@ def add_persons_sources(person,slist,private):
sbase = source_ref.getBase() sbase = source_ref.getBase()
if sbase != None and sbase not in slist: if sbase != None and sbase not in slist:
slist.append(sbase) slist.append(sbase)
for event in person.getAttibuteList:
for event in person.getAttibuteList():
if private and event.getPrivacy(): if private and event.getPrivacy():
continue continue
for source_ref in event.getSourceRefList(): for source_ref in event.getSourceRefList():
sbase = source_ref.getBase() sbase = source_ref.getBase()
if sbase != None and sbase not in slist: if sbase != None and sbase not in slist:
slist.append(sbase) slist.append(sbase)
for name in person.getNameList + [person.getPrimaryName()]:
for name in person.getNameList() + [person.getPrimaryName()]:
if private and name.getPrivacy(): if private and name.getPrivacy():
continue continue
for source_ref in name.getSourceRefList(): for source_ref in name.getSourceRefList():