From 9a1dece0dbac17ff61184345baf546789cbb8204 Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Sat, 14 May 2005 10:03:36 +0000 Subject: [PATCH] * src/GenericFilter.py (IsSiblingOfFilterMatch): Match only sibling, not the filterMatch; (HasEvent,HasFamilyEvent): Dont crash in filter editor. svn: r4592 --- gramps2/ChangeLog | 5 +++++ gramps2/src/GenericFilter.py | 27 ++++++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 21ce54350..c8634e0b2 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2005-05-14 Martin Hawlisch + * src/GenericFilter.py (IsSiblingOfFilterMatch): Match only sibling, + not the filterMatch; (HasEvent,HasFamilyEvent): Dont crash in filter + editor. + 2005-05-13 Don Allingham * src/plugins/ScratchPad.py: fix GdkAtom index problem with pygtk2.4 diff --git a/gramps2/src/GenericFilter.py b/gramps2/src/GenericFilter.py index de45d3ee6..97fc44ebf 100644 --- a/gramps2/src/GenericFilter.py +++ b/gramps2/src/GenericFilter.py @@ -650,7 +650,8 @@ class IsSiblingOfFilterMatch(Rule): fam = self.db.get_family_from_handle(fam_id) if fam: for child_handle in fam.get_child_handle_list(): - self.map[child_handle] = 1 + if child_handle != p_id: + self.map[child_handle] = 1 #------------------------------------------------------------------------- # @@ -1074,12 +1075,12 @@ class HasEvent(Rule): labels = [ _('Personal event:'), _('Date:'), _('Place:'), _('Description:') ] - def __init__(self,list): - Rule.__init__(self,list) - if self.list and self.list[1]: - self.date = DateHandler.parser.parse(self.list[1]) - else: - self.date = None + def prepare(self,list): + self.date = None + try: + if self.list and self.list[1]: + self.date = DateHandler.parser.parse(self.list[1]) + except: pass def name(self): return 'Has the personal event' @@ -1127,12 +1128,12 @@ class HasFamilyEvent(Rule): labels = [ _('Family event:'), _('Date:'), _('Place:'), _('Description:') ] - def __init__(self,list): - Rule.__init__(self,list) - if self.list and self.list[1]: - self.date = DateHandler.parser.parse(self.list[1]) - else: - self.date = None + def prepare(self,list): + self.date = None + try: + if self.list and self.list[1]: + self.date = DateHandler.parser.parse(self.list[1]) + except: pass def name(self): return 'Has the family event'