0001360: Gedcom input: SUBN and SUBM record handling

Fixed:
(a) Additional spaces beyond the first between a GEDCOM tag and the rest
of the line are not ignored.

(b) The SUBMitter name is ignored (it is overwritten by the XREF).

(c) SUBmissioN data items are not committed to the database.
This commit is contained in:
kulath 2015-04-24 10:51:08 +01:00
parent df1ffe06e1
commit 78c79202de

View File

@ -757,6 +757,10 @@ class Lexer(object):
if func: if func:
func(data) func(data)
else: else:
# There will normally only be one space between tag and
# line_value, but in case there is more then one, remove extra
# spaces after CONC/CONT processing
data = data[:2] + (data[2].strip(),) + data[3:]
self.current_list.insert(0, data) self.current_list.insert(0, data)
def clean_up(self): def clean_up(self):
@ -3260,7 +3264,10 @@ class GedcomParser(UpdateCallback):
if line.token_text == self.subm and self.import_researcher: if line.token_text == self.subm and self.import_researcher:
self.dbase.set_researcher(state.res) self.dbase.set_researcher(state.res)
submitter_name = _("SUBM (Submitter): @%s@") % line.token_text if state.res.get_name() == "":
submitter_name = _("SUBM (Submitter): @%s@") % line.token_text
else:
submitter_name = _("SUBM (Submitter): %s") % state.res.get_name()
if self.use_def_src: if self.use_def_src:
repo.set_name(submitter_name) repo.set_name(submitter_name)
repo.set_handle(Utils.create_id()) repo.set_handle(Utils.create_id())
@ -7250,6 +7257,7 @@ class GedcomParser(UpdateCallback):
if self.use_def_src and msg != "": if self.use_def_src and msg != "":
self.def_src.set_data_item(msg, line.data) self.def_src.set_data_item(msg, line.data)
self.dbase.commit_source(self.def_src, self.trans)
def handle_source(self, line, level, state): def handle_source(self, line, level, state):
""" """