* src/plugins/ReadGedcom.py: handle mangled temple format

produced by some tools


svn: r3169
This commit is contained in:
Don Allingham 2004-05-15 14:24:38 +00:00
parent da607cf048
commit f7b1a747fd

View File

@ -1084,7 +1084,9 @@ class GedcomParser:
self.backup() self.backup()
break break
elif matches[1] == "TEMP": elif matches[1] == "TEMP":
ord.set_temple(matches[2]) value = extract_temple(matches[2])
if value:
ord.setTemple(value)
elif matches[1] == "DATE": elif matches[1] == "DATE":
ord.set_date_object(self.extract_date(matches[2])) ord.set_date_object(self.extract_date(matches[2]))
elif matches[1] == "FAMC": elif matches[1] == "FAMC":
@ -1736,6 +1738,16 @@ class GedcomParser:
self.db.pmap_index = new_pmax 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
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# #