2006-06-11 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_ReadGedcom.py: fix event parsing
	* src/GramspDb/_GedcomInfo.py: fix ORDN identification



svn: r6882
This commit is contained in:
Don Allingham 2006-06-12 04:51:11 +00:00
parent 06cdb09731
commit 1545b277a8
3 changed files with 34 additions and 14 deletions

View File

@ -1,3 +1,7 @@
2006-06-11 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadGedcom.py: fix event parsing
* src/GramspDb/_GedcomInfo.py: fix ORDN identification
2006-06-10 Don Allingham <don@gramps-project.org> 2006-06-10 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadGedcom.py: fixes based of the gedcom torture test * src/GrampsDb/_ReadGedcom.py: fixes based of the gedcom torture test
* src/GrampsDb/_GedTokeys.py: fixes based of the gedcom torture test * src/GrampsDb/_GedTokeys.py: fixes based of the gedcom torture test

View File

@ -76,7 +76,7 @@ personalConstantEvents = {
RelLib.EventType.BLESS : "BLES", RelLib.EventType.BLESS : "BLES",
RelLib.EventType.BURIAL : "BURI", RelLib.EventType.BURIAL : "BURI",
RelLib.EventType.CAUSE_DEATH : "CAUS", RelLib.EventType.CAUSE_DEATH : "CAUS",
RelLib.EventType.ORDINATION : "ORDI", RelLib.EventType.ORDINATION : "ORDN",
RelLib.EventType.CENSUS : "CENS", RelLib.EventType.CENSUS : "CENS",
RelLib.EventType.CHRISTEN : "CHR" , RelLib.EventType.CHRISTEN : "CHR" ,
RelLib.EventType.CONFIRMATION : "CONF", RelLib.EventType.CONFIRMATION : "CONF",

View File

@ -620,6 +620,7 @@ class GedcomParser(UpdateCallback):
TOKEN__UID : self.func_person_attr, TOKEN__UID : self.func_person_attr,
TOKEN_ASSO : self.func_person_asso, TOKEN_ASSO : self.func_person_asso,
TOKEN_ANCI : self.skip_record, TOKEN_ANCI : self.skip_record,
TOKEN_SUBM : self.skip_record,
TOKEN_DESI : self.skip_record, TOKEN_DESI : self.skip_record,
TOKEN_RIN : self.skip_record, TOKEN_RIN : self.skip_record,
TOKEN__TODO : self.skip_record, TOKEN__TODO : self.skip_record,
@ -1464,6 +1465,7 @@ class GedcomParser(UpdateCallback):
'family' : Utils.family_name(self.family,self.db), 'family' : Utils.family_name(self.family,self.db),
} }
event.set_description(text) event.set_description(text)
self.db.add_event(event,self.trans) self.db.add_event(event,self.trans)
event_ref = RelLib.EventRef() event_ref = RelLib.EventRef()
@ -1809,7 +1811,10 @@ class GedcomParser(UpdateCallback):
name = RelLib.EventType((RelLib.EventType.CUSTOM,matches[3])) name = RelLib.EventType((RelLib.EventType.CUSTOM,matches[3]))
event.set_type(name) event.set_type(name)
else: else:
event.set_description(matches[2]) if not ged2gramps.has_key(matches[2]) and \
not ged2fam.has_key(matches[2]) and \
matches[2] != 'Y':
event.set_description(matches[2])
def func_event_privacy(self, matches, event, level): def func_event_privacy(self, matches, event, level):
event.set_privacy(True) event.set_privacy(True)
@ -2870,6 +2875,7 @@ class GedcomParser(UpdateCallback):
if matches[2]: if matches[2]:
event.set_description(matches[2]) event.set_description(matches[2])
person_event_name(event,state.person) person_event_name(event,state.person)
self.db.add_event(event, self.trans) self.db.add_event(event, self.trans)
event_ref = RelLib.EventRef() event_ref = RelLib.EventRef()
@ -2889,18 +2895,28 @@ class GedcomParser(UpdateCallback):
state.level+1,state.note)) state.level+1,state.note))
def func_name_alia(self,matches,state): def func_name_alia(self,matches,state):
aka = RelLib.Name() """
try: The ALIA tag is supposed to cross reference another person.
names = nameRegexp.match(matches[2]).groups() However, we do not support this.
except:
names = (matches[2],"","","","") Some systems use the ALIA tag as an alternate NAME tag, which
if names[0]: is not legal in GEDCOM, but oddly enough, is easy to support.
aka.set_first_name(names[0].strip()) """
if names[2]: if matches[2][0] == '@':
aka.set_surname(names[2].strip()) aka = RelLib.Name()
if names[4]: try:
aka.set_suffix(names[4].strip()) names = nameRegexp.match(matches[2]).groups()
state.person.add_alternate_name(aka) except:
names = (matches[2],"","","","")
if names[0]:
aka.set_first_name(names[0].strip())
if names[2]:
aka.set_surname(names[2].strip())
if names[4]:
aka.set_suffix(names[4].strip())
state.person.add_alternate_name(aka)
else:
pass
def func_name_npfx(self,matches,state): def func_name_npfx(self,matches,state):
state.name.set_title(matches[2].strip()) state.name.set_title(matches[2].strip())