* src/GrampsDbUtils/_ParseGedcom.py: check for MARR event in std_event,

not in family_even
	* src/RelLib/_FamilyRelType.py: default marriage type to unknown
	* src/GrampsDbUtils/_WriteGedcom.py: Don't add description to EVEN tag

2007-08-20  Don Allingham  <don@gramps-project.org>


svn: r8846
This commit is contained in:
Don Allingham 2007-08-21 04:17:12 +00:00
parent 30e6e38f2c
commit 21c59e9e8f
4 changed files with 21 additions and 20 deletions

View File

@ -1,6 +1,12 @@
2007-08-20 Jérôme Rapinat <romjerome@yahoo.fr> 2007-08-20 Jérôme Rapinat <romjerome@yahoo.fr>
* src/Relationship.py: Fix array bounds check. * src/Relationship.py: Fix array bounds check.
2007-08-20 Don Allingham <don@gramps-project.org>
* src/GrampsDbUtils/_ParseGedcom.py: check for MARR event in std_event,
not in family_even
* src/RelLib/_FamilyRelType.py: default marriage type to unknown
* src/GrampsDbUtils/_WriteGedcom.py: Don't add description to EVEN tag
2007-08-20 Don Allingham <don@gramps-project.org> 2007-08-20 Don Allingham <don@gramps-project.org>
* src/ScratchPad.py (ScratchPadSourceRef.__init__): handle the removal * src/ScratchPad.py (ScratchPadSourceRef.__init__): handle the removal
of the get_text() function of the get_text() function

View File

@ -2568,6 +2568,18 @@ class GedcomParser(UpdateCallback):
self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined) self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined)
if int(event.get_type()) == RelLib.EventType.MARRIAGE:
descr = event.get_description()
print "EVENT", str(event.get_type()), descr
if descr == "Civil Union":
state.family.type.set(RelLib.FamilyRelType.CIVIL_UNION)
event.set_description('')
elif descr == "Unmarried":
state.family.type.set(RelLib.FamilyRelType.UNMARRIED)
event.set_description('')
else:
state.family.type.set(RelLib.FamilyRelType.MARRIED)
family_event_name(event, state.family, self.dbase) family_event_name(event, state.family, self.dbase)
self.dbase.commit_event(event, self.trans) self.dbase.commit_event(event, self.trans)
event_ref.ref = event.handle event_ref.ref = event.handle
@ -2600,18 +2612,6 @@ class GedcomParser(UpdateCallback):
self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined) self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined)
if int(event.get_type()) == RelLib.EventType.MARRIAGE:
descr = event.get_description()
if descr == "Civil Union":
state.family.type.set(RelLib.FamilyRelType.CIVIL_UNION)
event.set_description('')
elif descr == "Unmarried":
state.family.type.set(RelLib.FamilyRelType.UNMARRIED)
event.set_description('')
else:
state.family.type.set(RelLib.FamilyRelType.MARRIED)
family_event_name(event, state.family, self.dbase) family_event_name(event, state.family, self.dbase)
self.dbase.commit_event(event, self.trans) self.dbase.commit_event(event, self.trans)

View File

@ -692,14 +692,7 @@ class GedcomWriter(UpdateCallback):
if event.get_description().strip(): if event.get_description().strip():
self.__writeln(2, 'TYPE', event.get_description()) self.__writeln(2, 'TYPE', event.get_description())
else: else:
# Actually, it is against the spec to put anything self.__writeln(1, 'EVEN')
# after EVEN on the same line, possibly an option is
# needed on how to handle this
if event.get_description().strip() != "":
self.__writeln(1, 'EVEN', event.get_description())
else:
self.__writeln(1, 'EVEN')
if val.strip(): if val.strip():
self.__writeln(2, 'TYPE', val) self.__writeln(2, 'TYPE', val)
else: else:

View File

@ -53,4 +53,6 @@ class FamilyRelType(GrampsType):
_E2IMAP = init_map(_DATAMAP, 2, 0) _E2IMAP = init_map(_DATAMAP, 2, 0)
def __init__(self, value=None): def __init__(self, value=None):
if value == None:
value = self.UNKNOWN
GrampsType.__init__(self, value) GrampsType.__init__(self, value)