0006069: GEDCOM import does not generally support MULTIMEDIA_LINKs in the embedded form

svn: r20450
This commit is contained in:
Tim G L Lyons 2012-09-25 18:15:13 +00:00
parent 534785ebb9
commit 269f6e60ae

View File

@ -2361,6 +2361,7 @@ class GedcomParser(UpdateCallback):
TOKEN_NOTE : self.__event_place_note, TOKEN_NOTE : self.__event_place_note,
TOKEN_RNOTE : self.__event_place_note, TOKEN_RNOTE : self.__event_place_note,
TOKEN_FORM : self.__event_place_form, TOKEN_FORM : self.__event_place_form,
# Not legal.
TOKEN_OBJE : self.__event_place_object, TOKEN_OBJE : self.__event_place_object,
TOKEN_SOUR : self.__event_place_sour, TOKEN_SOUR : self.__event_place_sour,
TOKEN__LOC : self.__ignore, TOKEN__LOC : self.__ignore,
@ -4764,7 +4765,13 @@ class GedcomParser(UpdateCallback):
@type state: CurrentState @type state: CurrentState
""" """
if line.data and line.data[0] == '@': if line.data and line.data[0] == '@':
self.__not_recognized(line, state.level, state) # Reference to a named multimedia object defined elsewhere
gramps_id = self.oid_map[line.data]
handle = self.__find_object_handle(gramps_id)
ref = gen.lib.MediaRef()
ref.set_reference_handle(handle)
state.family.add_media_reference(ref)
else: else:
(form, filename, title, note) = self.__obje(state.level + 1, state) (form, filename, title, note) = self.__obje(state.level + 1, state)
if filename == "": if filename == "":
@ -4967,7 +4974,13 @@ class GedcomParser(UpdateCallback):
@type state: CurrentState @type state: CurrentState
""" """
if line.data and line.data[0] == '@': if line.data and line.data[0] == '@':
self.__not_recognized(line, state.level, state) # Reference to a named multimedia object defined elsewhere
gramps_id = self.oid_map[line.data]
handle = self.__find_object_handle(gramps_id)
ref = gen.lib.MediaRef()
ref.set_reference_handle(handle)
state.event.add_media_reference(ref)
else: else:
(form, filename, title, note) = self.__obje(state.level + 1, state) (form, filename, title, note) = self.__obje(state.level + 1, state)
if filename == "": if filename == "":
@ -5097,7 +5110,13 @@ class GedcomParser(UpdateCallback):
@type state: CurrentState @type state: CurrentState
""" """
if line.data and line.data[0] == '@': if line.data and line.data[0] == '@':
self.__not_recognized(line, state.level, state) # Reference to a named multimedia object defined elsewhere
gramps_id = self.oid_map[line.data]
handle = self.__find_object_handle(gramps_id)
ref = gen.lib.MediaRef()
ref.set_reference_handle(handle)
state.place.add_media_reference(ref)
else: else:
# FIXME this should probably be level+1 # FIXME this should probably be level+1
(form, filename, title, note) = self.__obje(state.level, state) (form, filename, title, note) = self.__obje(state.level, state)
@ -5723,7 +5742,13 @@ class GedcomParser(UpdateCallback):
@type state: CurrentState @type state: CurrentState
""" """
if line.data and line.data[0] == '@': if line.data and line.data[0] == '@':
self.__not_recognized(line, state.level, state) # Reference to a named multimedia object defined elsewhere
gramps_id = self.oid_map[line.data]
handle = self.__find_object_handle(gramps_id)
ref = gen.lib.MediaRef()
ref.set_reference_handle(handle)
state.citation.add_media_reference(ref)
else: else:
(form, filename, title, note) = self.__obje(state.level+1, state) (form, filename, title, note) = self.__obje(state.level+1, state)
if filename == "": if filename == "":
@ -5860,7 +5885,13 @@ class GedcomParser(UpdateCallback):
@type state: CurrentState @type state: CurrentState
""" """
if line.data and line.data[0] == '@': if line.data and line.data[0] == '@':
self.__not_recognized(line, state.level, state) # Reference to a named multimedia object defined elsewhere
gramps_id = self.oid_map[line.data]
handle = self.__find_object_handle(gramps_id)
ref = gen.lib.MediaRef()
ref.set_reference_handle(handle)
state.source.add_media_reference(ref)
else: else:
(form, filename, title, note) = self.__obje(state.level+1, state) (form, filename, title, note) = self.__obje(state.level+1, state)
if filename == "": if filename == "":