2006-05-16 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_ReadGedcom.py: handle blank lines



svn: r6684
This commit is contained in:
Don Allingham 2006-05-17 01:23:14 +00:00
parent 2efa8ec971
commit 9ad577a0bc
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,6 @@
2006-05-16 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadGedcom.py: handle blank lines
2006-05-16 Alex Roitman <shura@gramps-project.org>
* src/Selectors/_SelectPerson.py: Use new package.
* src/plugins/RelCalc.py: Use new package.

View File

@ -449,9 +449,11 @@ class Reader:
def readahead(self):
while len(self.current_list) < 5:
line = self.f.readline()
old_line = self.f.readline()
self.index += 1
line = line.strip('\r\n')
line = old_line.strip('\r\n')
if line == "" and line != old_line:
continue
if line == "":
self.f.close()
self.eof = True
@ -1091,7 +1093,7 @@ class GedcomParser(UpdateCallback):
mrel = _TYPE_BIRTH
frel = _TYPE_BIRTH
# Legacy _PREF
elif matches[1][0] == TOKEN_UNKNOWN:
elif matches[1] and matches[1][0] == TOKEN_UNKNOWN:
pass
else:
self.barf(level+1)