From 617569a234ccfb82d47de9c78b9ef46e61c7ea13 Mon Sep 17 00:00:00 2001 From: prculley Date: Fri, 8 Jul 2016 11:47:18 -0500 Subject: [PATCH 1/2] Bug 9479 Gedcom import loses spaces in text fields from FTM --- data/tests/imp_test_FTM_CONC.difs | 17 ----------------- gramps/plugins/lib/libgedcom.py | 5 ++++- 2 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 data/tests/imp_test_FTM_CONC.difs diff --git a/data/tests/imp_test_FTM_CONC.difs b/data/tests/imp_test_FTM_CONC.difs deleted file mode 100644 index ebe47cf5f..000000000 --- a/data/tests/imp_test_FTM_CONC.difs +++ /dev/null @@ -1,17 +0,0 @@ -Mismatch on file: imp_test_FTM_CONC.ged -Source: S0029 handle=0000000500000005 - Diff on: Source, pubinfo - 73: Name: Ancestry.com Operations, Inc.; Location: Provo, UT, USA; Date:2009; - 74: Name: Ancestry.com Operations, Inc.; Location: Provo, UT, USA; Date: 2009; -Citation: C0000 handle=0000000600000006 - Diff on: Citation, page - 102: Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll:M432_394; Page: 435B; Image: 248 - 103: Year: 1850; Census Place: District 14, Cape Girardeau, Missouri; Roll: M432_394; Page: 435B; Image: 248 -Note: N0000 handle=0000000200000002 - Diff on: Note, text, string - 54: The FTM way to do a CONC line with space at end --><-- - 55: The FTM way to do a CONC line with space at end --> <-- -Note: N0002 handle=0000000400000004 - Diff on: Note, text, string - 136: Be nice if we supported FTM way to do CONC sousers would not have to spell check and edit their whole database for these kind of errors. - 137: Be nice if we supported FTM way to do CONC so users would not have to spell check and edit their whole database for these kind of errors. diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index e4f436c2e..c0ba15c73 100755 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -781,7 +781,10 @@ class Lexer: # There will normally only be one space between tag and # line_value, but in case there is more then one, remove extra # spaces after CONC/CONT processing - data = data[:2] + (data[2].strip(),) + data[3:] + # Also, Gedcom spec says there should be no spaces at end of + # line, however some programs put them there (FTM), so lets + # leave them in place. + data = data[:2] + (data[2].lstrip(),) + data[3:] self.current_list.insert(0, data) def clean_up(self): From e6923620ea46c194144b964c878b6cb17be3bb6e Mon Sep 17 00:00:00 2001 From: prculley Date: Sat, 16 Jul 2016 10:48:26 -0500 Subject: [PATCH 2/2] Typo --- gramps/plugins/lib/libgedcom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index c0ba15c73..738b574fc 100755 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -782,7 +782,7 @@ class Lexer: # line_value, but in case there is more then one, remove extra # spaces after CONC/CONT processing # Also, Gedcom spec says there should be no spaces at end of - # line, however some programs put them there (FTM), so lets + # line, however some programs put them there (FTM), so let's # leave them in place. data = data[:2] + (data[2].lstrip(),) + data[3:] self.current_list.insert(0, data)