Fix inline notes

svn: r110
This commit is contained in:
Don Allingham
2001-06-10 01:26:09 +00:00
parent 0482a14561
commit 6def86b441
9 changed files with 310 additions and 100 deletions

View File

@ -545,8 +545,9 @@ class GedcomParser:
else:
self.parse_person_object(2)
elif matches[1] == "NOTE":
if matches[2] and matches[2][0] != "@":
note = matches[1] + self.parse_continue_data(1)
print matches[2]
if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@":
note = matches[2] + self.parse_continue_data(1)
self.person.setNote(note)
self.ignore_sub_junk(2)
else:
@ -633,7 +634,7 @@ class GedcomParser:
self.backup()
return note
elif matches[1] == "NOTE":
if matches[2] and matches[2][0] != "@":
if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@":
note = matches[2] + self.parse_continue_data(level+1)
self.parse_note_data(level+1)
else:
@ -660,7 +661,7 @@ class GedcomParser:
elif matches[1] == "_PRIMARY":
type = matches[1]
elif matches[1] == "NOTE":
if matches[2] and matches[2][0] != "@":
if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@":
note = matches[2] + self.parse_continue_data(level+1)
self.parse_note_data(level+1)
else:
@ -786,7 +787,7 @@ class GedcomParser:
elif matches[1] == "PHON":
pass
elif matches[1] == "NOTE":
if matches[2] and matches[2][0] != "@":
if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@":
note = matches[1] + self.parse_continue_data(1)
self.address.setNote(note)
self.ignore_sub_junk(2)
@ -920,7 +921,7 @@ class GedcomParser:
event.setPlace(matches[2])
self.ignore_sub_junk(level+1)
elif matches[1] == "NOTE":
if matches[2] and matches[2][0] != "@":
if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@":
note = matches[1] + self.parse_continue_data(1)
event.setNote(note)
self.ignore_sub_junk(2)
@ -957,7 +958,7 @@ class GedcomParser:
elif matches[1] == "QUAY":
pass
elif matches[1] == "NOTE":
if matches[2] and matches[2][0] != "@":
if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@":
note = matches[1] + self.parse_continue_data(1)
source.setComments(note)
self.ignore_sub_junk(2)