* src/WriteGedcom.py: fix adopted relationship generation

svn: r4515
This commit is contained in:
Don Allingham 2005-05-09 03:55:09 +00:00
parent 0ec4626803
commit aa56da2c05
4 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,6 @@
2005-05-08 Don Allingham <don@gramps-project.org>
* src/WriteGedcom.py: fix adopted relationship generation
2005-05-08 Alex Roitman <shura@gramps-project.org>
* src/po/ru.po: Typos.

View File

@ -827,9 +827,10 @@ class GedcomWriter:
self.writeln('1 ADOP')
fam = None
for f in person.get_parent_family_handle_list():
mrel = f[1].lower()
frel = f[2].lower()
if mrel=="adopted" or frel=="adopted":
mrel = f[1]
frel = f[2]
if (mrel == RelLib.Person.CHILD_REL_ADOPT or
frel == RelLib.Person.CHILD_REL_ADOPT):
fam = f[0]
break
if fam:
@ -853,9 +854,10 @@ class GedcomWriter:
self.writeln('1 ADOP')
fam = None
for f in person.get_parent_family_handle_list():
mrel = f[1].lower()
frel = f[2].lower()
if mrel=="adopted" or frel=="adopted":
mrel = f[1]
frel = f[2]
if (mrel == RelLib.Person.CHILD_REL_ADOPT or
frel == RelLib.Person.CHILD_REL_ADOPT):
fam = f[0]
break
if fam:
@ -957,7 +959,7 @@ class GedcomWriter:
if self.flist.has_key(family[0]):
self.writeln("1 FAMC @%s@" % self.fid(family[0]))
if self.adopt == GedcomInfo.ADOPT_PEDI:
if family[1].lower() == "adopted":
if family[1] == RelLib.Person.CHILD_REL_ADOPT:
self.writeln("2 PEDI Adopted")
for family_handle in person.get_family_handle_list():

View File

@ -1247,6 +1247,9 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
ErrorDialog(_('Cannot open database'),
_('The database file specified could not be opened.'))
return 0
except ( IOError, OSError ), msg:
ErrorDialog(_('Cannot open database'),str(msg))
return 0
except db.DBAccessError, msg:
ErrorDialog(_('Cannot open database'),
_('%s could not be opened.' % filename) + '\n' + msg[1])

View File

@ -487,7 +487,10 @@ class CheckIntegrity:
else:
cn = _("Non existing person")
family = self.db.get_family_from_handle(family_handle)
pn = Utils.family_name(family,self.db)
if family:
pn = Utils.family_name(family,self.db)
else:
pn = family_handle
self.text.write('\t')
self.text.write(_("%s was restored to the family of %s\n") % (cn,pn))