From b28d22243ae55db377d6c0a8ee9bc2735744475e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 20 Nov 2003 04:18:10 +0000 Subject: [PATCH] * src/GrampsCfg.py: Add comment about SUSE naming of gconf * src/Relationship.py: detect a RuntimeError exception that occurs when we exceed the recursion depth limit. This occurs when a relationship loop is detected * src/gramps_main.py: handle relationship loop message svn: r2355 --- gramps2/src/GrampsCfg.py | 3 +++ gramps2/src/Relationship.py | 7 +++++-- gramps2/src/gramps_main.py | 7 +++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gramps2/src/GrampsCfg.py b/gramps2/src/GrampsCfg.py index 81bb7ad10..3dc48148a 100644 --- a/gramps2/src/GrampsCfg.py +++ b/gramps2/src/GrampsCfg.py @@ -42,6 +42,9 @@ import gtk.glade import gnome import gnome.ui +# +# SUSE calls the gconf module "gnome.gconf" +# try: import gconf except ImportError: diff --git a/gramps2/src/Relationship.py b/gramps2/src/Relationship.py index 8e3d99a2b..ed56fb5b5 100644 --- a/gramps2/src/Relationship.py +++ b/gramps2/src/Relationship.py @@ -218,8 +218,11 @@ def get_relationship(orig_person,other_person): if is_spouse(orig_person,other_person): return ("spouse",[]) - apply_filter(orig_person,0,firstList,firstMap) - apply_filter(other_person,0,secondList,secondMap) + try: + apply_filter(orig_person,0,firstList,firstMap) + apply_filter(other_person,0,secondList,secondMap) + except RuntimeError,msg: + return (_("Relationship loop detected"),None) for person in firstList: if person in secondList: diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index e4fe938e4..ee8679ec3 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -1366,8 +1366,11 @@ class Gramps: self.active_person) if name: - return _("%(relationship)s of %(person)s") % { - 'relationship' : name, 'person' : pname } + if plist == None: + return name + else: + return _("%(relationship)s of %(person)s") % { + 'relationship' : name, 'person' : pname } else: return "" except: