* src/GrampsDb/_GedTokens.py: handle some obscure tokens

svn: r6874
This commit is contained in:
Don Allingham 2006-06-08 04:51:45 +00:00
parent 4c16c41514
commit 81f86cefff
3 changed files with 10 additions and 8 deletions

View File

@ -4,6 +4,7 @@
2006-06-07 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadGedcom.py: fix child/parent relationships
* src/GrampsDb/_GedTokens.py: handle some obscure tokens
2006-06-06 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadGedcom.py: read gedcoms that we write

View File

@ -157,7 +157,7 @@ tokens = {
"DESI" : TOKEN_DESI, "DEST" : TOKEN_DEST,
"DESTINATION" : TOKEN_DEST, "ENDL" : TOKEN_ENDL,
"ENDOWMENT" : TOKEN_ENDL, "EVEN" : TOKEN_EVEN,
"EVENT" : TOKEN_EVEN,
"EVENT" : TOKEN_EVEN, "_ANCES_ORDRE" : TOKEN_IGNORE,
"FAM" : TOKEN_FAM, "FAMILY" : TOKEN_FAM,
"FAMC" : TOKEN_FAMC, "FAMILY_CHILD" : TOKEN_FAMC,
"FAMS" : TOKEN_FAMS, "FAMILY_SPOUSE" : TOKEN_FAMS,

View File

@ -440,7 +440,13 @@ class Reader:
break
line = line.split(None,2) + ['']
val = line[2].translate(_transtable,_delc)
try:
val = line[2].translate(_transtable,_delc)
except IndexError:
msg = _("Invalid GEDCOM syntax at line %d was ignored.") % self.index
log.warningg(msg)
continue
try:
val = self.cnv(val)
except:
@ -1771,7 +1777,7 @@ class GedcomParser(UpdateCallback):
self.def_src.set_publication_info(matches[2])
elif matches[1] == TOKEN_SUBM:
self.parse_subm(2)
elif matches[1] in (TOKEN_CORP,TOKEN_DATA,TOKEN_SUBN,TOKEN_LANG):
elif matches[1] in (TOKEN_CORP, TOKEN_DATA, TOKEN_SUBN, TOKEN_LANG, TOKEN_TIME):
self.ignore_sub_junk(2)
elif matches[1] == TOKEN_DEST:
if genby == "GRAMPS":
@ -2113,7 +2119,6 @@ class GedcomParser(UpdateCallback):
while True:
matches = self.get_next()
if self.level_is_finished(matches,2):
if not ignore:
state.person.add_person_ref(ref)
@ -2264,10 +2269,6 @@ class GedcomParser(UpdateCallback):
ref.set_father_relation(ftype)
family.add_child_ref(ref)
self.db.commit_family(family, self.trans)
print "---------------"
print "p",state.person.handle, "f",family.handle
print state.person.parent_family_list
print [ ref.ref for ref in family.get_child_ref_list() ]
def func_person_resi(self,matches,state):
"""