From b43e13d6c497e45b8ec807d456e6ab2ead68d8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Thu, 11 Nov 2010 14:55:36 +0000 Subject: [PATCH] 4345: custom TIME on eventdate svn: r16178 --- src/gen/lib/attrtype.py | 2 ++ src/plugins/lib/libgedcom.py | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/gen/lib/attrtype.py b/src/gen/lib/attrtype.py index 2e348f20a..b703b9376 100644 --- a/src/gen/lib/attrtype.py +++ b/src/gen/lib/attrtype.py @@ -54,6 +54,7 @@ class AttributeType(GrampsType): FATHER_AGE = 11 MOTHER_AGE = 12 WITNESS = 13 + TIME = 14 _CUSTOM = CUSTOM _DEFAULT = ID @@ -74,6 +75,7 @@ class AttributeType(GrampsType): (FATHER_AGE , _("Father's Age"), "Father Age"), (MOTHER_AGE , _("Mother's Age"), "Mother Age"), (WITNESS , _("Witness"), "Witness"), + (TIME , _("Time"), "Time"), ] def __init__(self, value=None): diff --git a/src/plugins/lib/libgedcom.py b/src/plugins/lib/libgedcom.py index b78641f20..4c400d17a 100644 --- a/src/plugins/lib/libgedcom.py +++ b/src/plugins/lib/libgedcom.py @@ -1919,7 +1919,8 @@ class GedcomParser(UpdateCallback): TOKEN__WITN : self.__event_witness, TOKEN__WTN : self.__event_witness, TOKEN_RELI : self.__ignore, - TOKEN_TIME : self.__ignore, + TOKEN_TIME : self.__ignore, + TOKEN__TIME : self.__event_time, TOKEN_ASSO : self.__ignore, TOKEN_IGNORE : self.__ignore, TOKEN_STAT : self.__ignore, @@ -4526,6 +4527,18 @@ class GedcomParser(UpdateCallback): attr.set_value(line.data) state.event.add_attribute(attr) + def __event_time(self, line, state): + """ + @param line: The current line in GedLine format + @type line: GedLine + @param state: The current state + @type state: CurrentState + """ + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.TIME) + attr.set_value(line.data) + state.event.add_attribute(attr) + def __event_witness(self, line, state): """ Parse the witness of an event