From 59713402ace4ab5c5f49d850ca29d04d18d1649d Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 23 May 2007 04:22:52 +0000 Subject: [PATCH] 2007-05-22 Don Allingham * src/DataViews/_PedigreeView.py (PedigreeView.find_tree): Catch recursion error svn: r8508 --- gramps2/ChangeLog | 3 +++ gramps2/configure.in | 6 +++--- gramps2/src/DataViews/_PedigreeView.py | 9 +++++++-- gramps2/src/DbLoader.py | 16 +++++++--------- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 9a2b2ca6a..d814267a4 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2007-05-22 Don Allingham + * src/DataViews/_PedigreeView.py (PedigreeView.find_tree): Catch recursion error + 2007-05-18 Brian Matherly * src/plugins/NarrativeWeb.py: fix gallery image links generated on Win32 diff --git a/gramps2/configure.in b/gramps2/configure.in index c8727ee22..9eee10e5b 100644 --- a/gramps2/configure.in +++ b/gramps2/configure.in @@ -4,15 +4,15 @@ dnl Process this file with autoconf to produce a configure script. dnl May need to run automake && aclocal first AC_PREREQ(2.57) -AC_INIT(gramps, 2.2.7, [gramps-bugs@lists.sourceforge.net]) +AC_INIT(gramps, 2.2.8, [gramps-bugs@lists.sourceforge.net]) AC_CONFIG_SRCDIR(configure.in) AM_INIT_AUTOMAKE(1.6.3) AC_CONFIG_MACRO_DIR([m4]) GNOME_DOC_INIT -dnl RELEASE=0.SVN$(svnversion -n .) -RELEASE=1 +RELEASE=0.SVN$(svnversion -n .) +dnl RELEASE=1 VERSIONSTRING=$VERSION if test x"$RELEASE" != "x" diff --git a/gramps2/src/DataViews/_PedigreeView.py b/gramps2/src/DataViews/_PedigreeView.py index b36e2025c..61af313b0 100644 --- a/gramps2/src/DataViews/_PedigreeView.py +++ b/gramps2/src/DataViews/_PedigreeView.py @@ -61,7 +61,7 @@ from Editors import EditPerson, EditFamily from DdTargets import DdTargets import cPickle as pickle -from QuestionDialog import RunDatabaseRepair +from QuestionDialog import RunDatabaseRepair, ErrorDialog #------------------------------------------------------------------------- # @@ -1265,7 +1265,12 @@ class PedigreeView(PageView.PersonNavView): if depth > 5 or person == None: return - alive = Utils.probably_alive(person, self.dbstate.db) + try: + alive = Utils.probably_alive(person, self.dbstate.db) + except RuntimeError: + ErrorDialog(_('Relationship loop detected'), + _('A person was found to be his/her own ancestor.')) + alive = False lst[index] = (person,val,None,alive) diff --git a/gramps2/src/DbLoader.py b/gramps2/src/DbLoader.py index 95f4a62cd..62aba7936 100644 --- a/gramps2/src/DbLoader.py +++ b/gramps2/src/DbLoader.py @@ -446,25 +446,23 @@ class DbLoader: os.chdir(os.path.dirname(filename)) except: print "could not change directory" - except (DBAccessError, DBPageNotFoundError, - DBInvalidArgError, DBRunRecoveryError), msg: + except DBRunRecoveryError, msg: QuestionDialog.ErrorDialog( _("Low level database corruption detected"), _("GRAMPS has detected a problem in the underlying " - "Berkeley database. If you have renamed this file, " - "change the name back to its original name. If you have " - "copied the file from another machine, this file is not " - "usable. Export your data to XML on the original machine " - "and import it into a new database.\n\nOtherwise, " - "please exit the program, and GRAMPS " + "Berkeley database. Please exit the program, and GRAMPS " "will attempt to run the recovery repair operation " "the next time you open this database. If this " "problem persists, create a new database, import " "from a backup database, and report the problem to " "gramps-bugs@lists.sourceforge.net.")) + except (DBAccessError, DBPageNotFoundError,DBInvalidArgError), msg: + QuestionDialog.ErrorDialog( + _("Could not open file: %s") % filename, + str(msg[1])) except Exception, msg: QuestionDialog.ErrorDialog( - _("Could not open file: %s") % filename, msg ) + _("Could not open file: %s") % filename, msg ) return True def open_saved_as(self, filename, filetype):