From 246b3e0bd524a8366a838fbc598a6efd446878e9 Mon Sep 17 00:00:00 2001 From: Gary Burton Date: Fri, 12 Dec 2008 21:58:39 +0000 Subject: [PATCH] Gedcom compliance. Bug #2555: Blanks at the begining of Gedcom CONT fields. svn: r11465 --- src/GrampsDbUtils/_GedcomLex.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/GrampsDbUtils/_GedcomLex.py b/src/GrampsDbUtils/_GedcomLex.py index 15d387fd6..d4ab3087a 100644 --- a/src/GrampsDbUtils/_GedcomLex.py +++ b/src/GrampsDbUtils/_GedcomLex.py @@ -372,8 +372,13 @@ class Reader: # the space ensures no trailing whitespace on last parm 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'): + if line[1] == 'CONC' or line[2].startswith('NOTE'): line = linetmp.strip('\n\r').split(None, 2) + [''] + elif line[1] == 'CONT': + # Make sure that whitespace is preserved at start and + # end of CONT data + part_line = linetmp.strip('\n\r').partition(' CONT ') + line = [part_line[0]] + ['CONT'] + [part_line[2]] + [''] level = int(line[0]) except: continue