diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 1b747e4da..4bb2775ca 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,6 @@ 2006-04-05 Don Allingham + * src/GrampsDb/_ReadXML.py: support new lds stuff + * src/GrampsDb/_WriteXML.py: support new lds stuff * src/GrampsDb/_ReadGedcom.py: support new lds stuff * src/GrampsDb/_WriteGedcom.py: support new lds stuff * src/Editors/_EditLdsOrd.py: save place information diff --git a/gramps2/src/GrampsDb/_ReadXML.py b/gramps2/src/GrampsDb/_ReadXML.py index 60ac04651..d4366d222 100644 --- a/gramps2/src/GrampsDb/_ReadXML.py +++ b/gramps2/src/GrampsDb/_ReadXML.py @@ -628,14 +628,16 @@ class GrampsParser: self.ord = RelLib.LdsOrd() if self.person: if atype == "baptism": - self.person.set_lds_baptism(self.ord) + self.ord.set_type(RelLib.LdsOrd.BAPTISM) elif atype == "endowment": - self.person.set_lds_endowment(self.ord) + self.ord.set_type(RelLib.LdsOrd.ENDOWMENT) elif atype == "sealed_to_parents": - self.person.set_lds_sealing(self.ord) + self.ord.set_type(RelLib.LdsOrd.SEAL_TO_PARENTS) + self.person.lds_ord_list.append(self.ord) elif self.family: if atype == "sealed_to_spouse": - self.family.set_lds_sealing(self.ord) + self.ord.set_type(RelLib.LdsOrd.SEAL_TO_SPOUSES) + self.family.lds_ord_list.append(self.ord) def start_temple(self,attrs): self.ord.set_temple(attrs['val']) diff --git a/gramps2/src/GrampsDb/_WriteXML.py b/gramps2/src/GrampsDb/_WriteXML.py index 1eb1b1c8e..4f85b3192 100644 --- a/gramps2/src/GrampsDb/_WriteXML.py +++ b/gramps2/src/GrampsDb/_WriteXML.py @@ -79,6 +79,13 @@ except: _xml_version = "1.1.0" +lds_map = { + RelLib.LdsOrd.BAPTISM : 'baptism', + RelLib.LdsOrd.ENDOWMENT : 'endowment', + RelLib.LdsOrd.SEAL_TO_PARENTS : 'sealed_to_parents', + RelLib.LdsOrd.SEAL_TO_SPOUSE : 'sealed_to_spouse', + } + #------------------------------------------------------------------------- # # @@ -397,10 +404,8 @@ class XmlWriter: for event_ref in person.get_event_ref_list(): self.dump_event_ref(event_ref,index+1) - self.dump_ordinance("baptism",person.get_lds_baptism(),index+1) - self.dump_ordinance("endowment",person.get_lds_endowment(),index+1) - self.dump_ordinance("sealed_to_parents", - person.get_lds_sealing(),index+1) + for lds_ord in person.lds_ord_list: + self.dump_ordinance(lds_ord,index+1) self.write_media_list(person.get_media_list(),index+1) @@ -441,8 +446,8 @@ class XmlWriter: self.write_ref("mother",mhandle,index+1) for event_ref in family.get_event_ref_list(): self.dump_event_ref(event_ref,3) - self.dump_ordinance("sealed_to_spouse", - family.get_lds_sealing(),index+1) + for lds_ord in family.lds_ord_list: + self.dump_ordinance(lds_ord,index+1) self.write_media_list(family.get_media_list(),index+1) @@ -545,9 +550,9 @@ class XmlWriter: self.write_media_list(event.get_media_list(),index+1) self.g.write("%s\n" % sp) - def dump_ordinance(self,name,ord,index=1): - if not ord: - return + def dump_ordinance(self,ord,index=1): + + name = lds_map[ord.get_type()] sp = " " * index sp2 = " " * (index+1)