* src/GrampsDbUtils/_GedcomParse.py: Fix level of handle_source calls

* src/GrampsDbUtils/_GedcomLex.py: fix typo



svn: r8261
This commit is contained in:
Martin Hawlisch 2007-03-02 16:24:14 +00:00
parent feab448eda
commit 12ac250d3e
3 changed files with 20 additions and 14 deletions

View File

@ -1,3 +1,7 @@
2007-02-28 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/GrampsDbUtils/_GedcomParse.py: Fix level of handle_source calls
* src/GrampsDbUtils/_GedcomLex.py: fix typo
2007-02-28 Don Allingham <don@gramps-project.org> 2007-02-28 Don Allingham <don@gramps-project.org>
* src/GrampsDbUtils/_GedcomParse.py: more enhancements * src/GrampsDbUtils/_GedcomParse.py: more enhancements
* src/GrampsDbUtils/_GedcomChar.py: more enhancements * src/GrampsDbUtils/_GedcomChar.py: more enhancements

View File

@ -329,7 +329,7 @@ class Reader:
def set_broken_conc(self, broken): def set_broken_conc(self, broken):
self.func_map = { self.func_map = {
TOKEN_CONT : self.__fix_token_cont, TOKEN_CONT : self.__fix_token_cont,
p TOKEN_CONC : self.__fix_token_broken_conc, TOKEN_CONC : self.__fix_token_broken_conc,
} }
def readline(self): def readline(self):

View File

@ -1322,7 +1322,7 @@ class GedcomParser(UpdateCallback):
@param state: The current state @param state: The current state
@type state: CurrentState @type state: CurrentState
""" """
source_ref = self.handle_source(line, state.level+1) source_ref = self.handle_source(line, state.level)
state.person.add_source_reference(source_ref) state.person.add_source_reference(source_ref)
def __person_refn(self, line, state): def __person_refn(self, line, state):
@ -1682,10 +1682,12 @@ class GedcomParser(UpdateCallback):
@param state: The current state @param state: The current state
@type state: CurrentState @type state: CurrentState
""" """
state.addr = RelLib.Address() sub_state = GedcomUtils.CurrentState()
state.addr.set_street(line.data) sub_state.level = state.level+1
state.person.add_address(state.addr) sub_state.addr = RelLib.Address()
self.__parse_level(state, self.parse_addr_tbl, self.__ignore) sub_state.addr.set_street(line.data)
state.person.add_address(sub_state.addr)
self.__parse_level(sub_state, self.parse_addr_tbl, self.__ignore)
def __person_phon(self, line, state): def __person_phon(self, line, state):
""" """
@ -1880,7 +1882,7 @@ class GedcomParser(UpdateCallback):
@param state: The current state @param state: The current state
@type state: CurrentState @type state: CurrentState
""" """
sref = self.handle_source(line, state.level+1) sref = self.handle_source(line, state.level)
state.name.add_source_reference(sref) state.name.add_source_reference(sref)
def __person_resi(self, line, state): def __person_resi(self, line, state):
@ -1954,7 +1956,7 @@ class GedcomParser(UpdateCallback):
@param state: The current state @param state: The current state
@type state: CurrentState @type state: CurrentState
""" """
state.addr.add_source_reference(self.handle_source(line, state.level+1)) state.addr.add_source_reference(self.handle_source(line, state.level))
def __person_resi_plac(self, line, state): def __person_resi_plac(self, line, state):
""" """
@ -2162,7 +2164,7 @@ class GedcomParser(UpdateCallback):
@param state: The current state @param state: The current state
@type state: CurrentState @type state: CurrentState
""" """
srcref = self.handle_source(line, state.level+1) srcref = self.handle_source(line, state.level)
state.lds_ord.add_source_reference(srcref) state.lds_ord.add_source_reference(srcref)
def __lds_note(self, line, state): def __lds_note(self, line, state):
@ -2665,7 +2667,7 @@ class GedcomParser(UpdateCallback):
@param state: The current state @param state: The current state
@type state: CurrentState @type state: CurrentState
""" """
source_ref = self.handle_source(line, state.level+1) source_ref = self.handle_source(line, state.level)
state.family.add_source_reference(source_ref) state.family.add_source_reference(source_ref)
def __family_object(self, line, state): def __family_object(self, line, state):
@ -3111,6 +3113,7 @@ class GedcomParser(UpdateCallback):
sub_state = GedcomUtils.CurrentState() sub_state = GedcomUtils.CurrentState()
sub_state.event = state.event sub_state.event = state.event
sub_state.level = state.level + 1 sub_state.level = state.level + 1
sub_state.attr = attr
self.__parse_level(sub_state, self.event_cause_tbl, self.__undefined) self.__parse_level(sub_state, self.event_cause_tbl, self.__undefined)
@ -3121,8 +3124,7 @@ class GedcomParser(UpdateCallback):
@param state: The current state @param state: The current state
@type state: CurrentState @type state: CurrentState
""" """
state.event.add_source_reference(self.handle_source(line, state.attr.add_source_reference(self.handle_source(line, state.level))
state.level+1))
def __event_age(self, line, state): def __event_age(self, line, state):
""" """
@ -3383,7 +3385,7 @@ class GedcomParser(UpdateCallback):
@param state: The current state @param state: The current state
@type state: CurrentState @type state: CurrentState
""" """
state.addr.add_source_reference(self.handle_source(line, state.level+1)) state.addr.add_source_reference(self.handle_source(line, state.level))
def __address_note(self, line, state): def __address_note(self, line, state):
""" """
@ -4189,7 +4191,7 @@ class GedcomParser(UpdateCallback):
@type state: CurrentState @type state: CurrentState
""" """
if self.use_def_src: if self.use_def_src:
self.__parse_note(line, self.def_src, 2, '') self.__parse_note(line, self.def_src, 2)
def __header_subm_name(self, line, state): def __header_subm_name(self, line, state):
""" """