From aa56da2c050b2a0f8df568d1cf28c5e9e0010f53 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 9 May 2005 03:55:09 +0000 Subject: [PATCH] * src/WriteGedcom.py: fix adopted relationship generation svn: r4515 --- gramps2/ChangeLog | 3 +++ gramps2/src/WriteGedcom.py | 16 +++++++++------- gramps2/src/gramps_main.py | 3 +++ gramps2/src/plugins/Check.py | 5 ++++- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index ae421a90d..40fb12fb6 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2005-05-08 Don Allingham + * src/WriteGedcom.py: fix adopted relationship generation + 2005-05-08 Alex Roitman * src/po/ru.po: Typos. diff --git a/gramps2/src/WriteGedcom.py b/gramps2/src/WriteGedcom.py index 75173b070..a088dad80 100644 --- a/gramps2/src/WriteGedcom.py +++ b/gramps2/src/WriteGedcom.py @@ -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(): diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index b049cfb36..3754a9f31 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -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]) diff --git a/gramps2/src/plugins/Check.py b/gramps2/src/plugins/Check.py index d477eed19..f3ca745ac 100644 --- a/gramps2/src/plugins/Check.py +++ b/gramps2/src/plugins/Check.py @@ -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))