From f7b1a747fd61b106992da57f2941aebf2ce900f2 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 15 May 2004 14:24:38 +0000 Subject: [PATCH] * src/plugins/ReadGedcom.py: handle mangled temple format produced by some tools svn: r3169 --- src/plugins/ReadGedcom.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/plugins/ReadGedcom.py b/src/plugins/ReadGedcom.py index 613dc741c..bf84f9dd6 100644 --- a/src/plugins/ReadGedcom.py +++ b/src/plugins/ReadGedcom.py @@ -1084,7 +1084,9 @@ class GedcomParser: self.backup() break elif matches[1] == "TEMP": - ord.set_temple(matches[2]) + value = extract_temple(matches[2]) + if value: + ord.setTemple(value) elif matches[1] == "DATE": ord.set_date_object(self.extract_date(matches[2])) elif matches[1] == "FAMC": @@ -1736,6 +1738,16 @@ class GedcomParser: self.db.pmap_index = new_pmax +def extract_temple(text): + try: + if const.lds_temple_to_abrev.has_key(matches[2]): + return const.lds_temple_to_abrev[matches[2]] + else: + values = split(matches[2]) + return const.lds_temple_to_abrev[values[0]] + except: + return None + #------------------------------------------------------------------------- # #