From 83dfb87696dc576b810cc9ea83cf9d19c88b482e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Thu, 25 Jun 2009 17:20:29 +0000 Subject: [PATCH] 2831: missing filter rule on Event object matching source reference svn: r12706 --- src/Filters/Rules/Event/Makefile.am | 1 + src/Filters/Rules/Event/_HasSource.py | 44 +++++++++++++++++++++++++++ src/Filters/Rules/Event/__init__.py | 2 ++ 3 files changed, 47 insertions(+) create mode 100644 src/Filters/Rules/Event/_HasSource.py diff --git a/src/Filters/Rules/Event/Makefile.am b/src/Filters/Rules/Event/Makefile.am index 86d1d1006..111ac0d8e 100644 --- a/src/Filters/Rules/Event/Makefile.am +++ b/src/Filters/Rules/Event/Makefile.am @@ -14,6 +14,7 @@ pkgdata_PYTHON = \ _HasIdOf.py\ _HasMarkerOf.py\ _HasNote.py \ + _HasSource.py \ _HasType.py\ _HasNoteMatchingSubstringOf.py\ _HasReferenceCountOf.py\ diff --git a/src/Filters/Rules/Event/_HasSource.py b/src/Filters/Rules/Event/_HasSource.py new file mode 100644 index 000000000..abcdc3181 --- /dev/null +++ b/src/Filters/Rules/Event/_HasSource.py @@ -0,0 +1,44 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2002-2007 Donald N. Allingham +# Copyright (C) 2007-2009 Brian G. Matherly +# Copyright (C) 2009 Benny Malengier +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._HasSourceBase import HasSourceBase + +#------------------------------------------------------------------------- +# "People having sources" +#------------------------------------------------------------------------- +class HasSource(HasSourceBase): + """Events with sources""" + + name = _('Events with source') + description = _("Matches events with a certain number of items in the source") diff --git a/src/Filters/Rules/Event/__init__.py b/src/Filters/Rules/Event/__init__.py index c3734dbec..662b18af1 100644 --- a/src/Filters/Rules/Event/__init__.py +++ b/src/Filters/Rules/Event/__init__.py @@ -37,6 +37,7 @@ from _HasNote import HasNote from _HasNoteRegexp import HasNoteRegexp from _HasNoteMatchingSubstringOf import HasNoteMatchingSubstringOf from _HasReferenceCountOf import HasReferenceCountOf +from _HasSource import HasSource from _EventPrivate import EventPrivate from _MatchesFilter import MatchesFilter from _MatchesPersonFilter import MatchesPersonFilter @@ -57,6 +58,7 @@ editor_rule_list = [ HasNoteRegexp, HasNoteMatchingSubstringOf, HasReferenceCountOf, + HasSource, EventPrivate, MatchesFilter, MatchesPersonFilter,