From 83edeb4a62dabb545af0e540ed212d919b132023 Mon Sep 17 00:00:00 2001 From: Gary Burton Date: Fri, 5 Sep 2008 19:33:48 +0000 Subject: [PATCH] Retain whitespace when importing notes. Bug #2357 svn: r11023 --- src/GrampsDbUtils/_GedcomLex.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/GrampsDbUtils/_GedcomLex.py b/src/GrampsDbUtils/_GedcomLex.py index 649f32fc9..15d387fd6 100644 --- a/src/GrampsDbUtils/_GedcomLex.py +++ b/src/GrampsDbUtils/_GedcomLex.py @@ -362,15 +362,18 @@ class Reader: def __readahead(self): while len(self.current_list) < 5: - line = self.ifile.readline() + linetmp = self.ifile.readline() self.index += 1 - if not line: + if not linetmp: self.eof = True return try: # the space ensures no trailing whitespace on last parm - line = line.strip(' \n\r').split(None, 2) + [''] + line = linetmp.strip(' \n\r').split(None, 2) + [''] + # however keep trailing whitespace on notes only + if line[1] in ['CONT', 'CONC'] or line[2].startswith('NOTE'): + line = linetmp.strip('\n\r').split(None, 2) + [''] level = int(line[0]) except: continue