4345: custom TIME on eventdate
svn: r16178
This commit is contained in:
@ -54,6 +54,7 @@ class AttributeType(GrampsType):
|
|||||||
FATHER_AGE = 11
|
FATHER_AGE = 11
|
||||||
MOTHER_AGE = 12
|
MOTHER_AGE = 12
|
||||||
WITNESS = 13
|
WITNESS = 13
|
||||||
|
TIME = 14
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = ID
|
_DEFAULT = ID
|
||||||
@ -74,6 +75,7 @@ class AttributeType(GrampsType):
|
|||||||
(FATHER_AGE , _("Father's Age"), "Father Age"),
|
(FATHER_AGE , _("Father's Age"), "Father Age"),
|
||||||
(MOTHER_AGE , _("Mother's Age"), "Mother Age"),
|
(MOTHER_AGE , _("Mother's Age"), "Mother Age"),
|
||||||
(WITNESS , _("Witness"), "Witness"),
|
(WITNESS , _("Witness"), "Witness"),
|
||||||
|
(TIME , _("Time"), "Time"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
|
@ -1919,7 +1919,8 @@ class GedcomParser(UpdateCallback):
|
|||||||
TOKEN__WITN : self.__event_witness,
|
TOKEN__WITN : self.__event_witness,
|
||||||
TOKEN__WTN : self.__event_witness,
|
TOKEN__WTN : self.__event_witness,
|
||||||
TOKEN_RELI : self.__ignore,
|
TOKEN_RELI : self.__ignore,
|
||||||
TOKEN_TIME : self.__ignore,
|
TOKEN_TIME : self.__ignore,
|
||||||
|
TOKEN__TIME : self.__event_time,
|
||||||
TOKEN_ASSO : self.__ignore,
|
TOKEN_ASSO : self.__ignore,
|
||||||
TOKEN_IGNORE : self.__ignore,
|
TOKEN_IGNORE : self.__ignore,
|
||||||
TOKEN_STAT : self.__ignore,
|
TOKEN_STAT : self.__ignore,
|
||||||
@ -4526,6 +4527,18 @@ class GedcomParser(UpdateCallback):
|
|||||||
attr.set_value(line.data)
|
attr.set_value(line.data)
|
||||||
state.event.add_attribute(attr)
|
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):
|
def __event_witness(self, line, state):
|
||||||
"""
|
"""
|
||||||
Parse the witness of an event
|
Parse the witness of an event
|
||||||
|
Reference in New Issue
Block a user