4345: custom TIME on eventdate
svn: r16178
This commit is contained in:
parent
08e91b98cf
commit
b43e13d6c4
@ -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):
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user