From 77b46f0abb9c7cc7b1399f093b7c2d804389967a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sun, 2 Nov 2008 09:35:19 +0000 Subject: [PATCH] 2465: More rules according to User Interface Object tabs svn: r11235 --- src/Filters/Rules/Event/_HasNote.py | 47 +++++++++++++++++++++++++ src/Filters/Rules/Event/__init__.py | 2 ++ src/Filters/Rules/Family/_HasNote.py | 47 +++++++++++++++++++++++++ src/Filters/Rules/Family/_HasSource.py | 47 +++++++++++++++++++++++++ src/Filters/Rules/Family/__init__.py | 4 +++ src/Filters/Rules/Person/_HasAddress.py | 4 +-- src/Filters/Rules/Person/_HasSource.py | 47 +++++++++++++++++++++++++ src/Filters/Rules/Person/__init__.py | 2 ++ src/Filters/Rules/Place/_HasNote.py | 47 +++++++++++++++++++++++++ src/Filters/Rules/Place/__init__.py | 2 ++ src/Filters/Rules/Source/_HasNote.py | 47 +++++++++++++++++++++++++ src/Filters/Rules/Source/__init__.py | 2 ++ 12 files changed, 296 insertions(+), 2 deletions(-) create mode 100755 src/Filters/Rules/Event/_HasNote.py create mode 100755 src/Filters/Rules/Family/_HasNote.py create mode 100755 src/Filters/Rules/Family/_HasSource.py create mode 100755 src/Filters/Rules/Person/_HasSource.py create mode 100755 src/Filters/Rules/Place/_HasNote.py create mode 100755 src/Filters/Rules/Source/_HasNote.py diff --git a/src/Filters/Rules/Event/_HasNote.py b/src/Filters/Rules/Event/_HasNote.py new file mode 100755 index 000000000..3ee38979b --- /dev/null +++ b/src/Filters/Rules/Event/_HasNote.py @@ -0,0 +1,47 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2002-2007 Donald N. Allingham +# Copyright (C) 2007-2008 Brian G. Matherly +# Copyright (C) 2008 Jerome Rapinat +# Copyright (C) 2008 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 +# + +# $Id: _HasNote.py 9912 2008-01-22 09:17:46Z acraphae $ + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._HasNoteBase import HasNoteBase + +#------------------------------------------------------------------------- +# "Events having notes" +#------------------------------------------------------------------------- +class HasNote(HasNoteBase): + """Events having notes""" + + name = _('Events having note') + description = _("Matches events that have a note") diff --git a/src/Filters/Rules/Event/__init__.py b/src/Filters/Rules/Event/__init__.py index 9dba9118d..378035a27 100644 --- a/src/Filters/Rules/Event/__init__.py +++ b/src/Filters/Rules/Event/__init__.py @@ -33,6 +33,7 @@ from _AllEvents import AllEvents from _HasGallery import HasGallery from _HasIdOf import HasIdOf from _RegExpIdOf import RegExpIdOf +from _HasNote import HasNote from _HasNoteRegexp import HasNoteRegexp from _HasNoteMatchingSubstringOf import HasNoteMatchingSubstringOf from _HasReferenceCountOf import HasReferenceCountOf @@ -51,6 +52,7 @@ editor_rule_list = [ # TODO: At the time of this writing, the GRAMPS UI does not allow setting markers for events. 1197 bug-report # HasMarkerOf, RegExpIdOf, + HasNote, HasNoteRegexp, HasNoteMatchingSubstringOf, HasReferenceCountOf, diff --git a/src/Filters/Rules/Family/_HasNote.py b/src/Filters/Rules/Family/_HasNote.py new file mode 100755 index 000000000..299bf8ba0 --- /dev/null +++ b/src/Filters/Rules/Family/_HasNote.py @@ -0,0 +1,47 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2002-2007 Donald N. Allingham +# Copyright (C) 2007-2008 Brian G. Matherly +# Copyright (C) 2008 Jerome Rapinat +# Copyright (C) 2008 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 +# + +# $Id: _HasNote.py 9912 2008-01-22 09:17:46Z acraphae $ + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._HasNoteBase import HasNoteBase + +#------------------------------------------------------------------------- +# "Families having notes" +#------------------------------------------------------------------------- +class HasNote(HasNoteBase): + """Families having notes""" + + name = _('Families having note') + description = _("Matches families that have a note") diff --git a/src/Filters/Rules/Family/_HasSource.py b/src/Filters/Rules/Family/_HasSource.py new file mode 100755 index 000000000..d9af0184e --- /dev/null +++ b/src/Filters/Rules/Family/_HasSource.py @@ -0,0 +1,47 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2002-2007 Donald N. Allingham +# Copyright (C) 2007-2008 Brian G. Matherly +# Copyright (C) 2008 Jerome Rapinat +# Copyright (C) 2008 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 +# + +# $Id: _HasNote.py 9912 2008-01-22 09:17:46Z acraphae $ + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._HasSourceBase import HasSourceBase + +#------------------------------------------------------------------------- +# "Families having sources" +#------------------------------------------------------------------------- +class HasSource(HasSourceBase): + """Families with sources""" + + name = _('Families with source') + description = _("Matches families with a source") diff --git a/src/Filters/Rules/Family/__init__.py b/src/Filters/Rules/Family/__init__.py index 227c76981..8fd9c4db6 100644 --- a/src/Filters/Rules/Family/__init__.py +++ b/src/Filters/Rules/Family/__init__.py @@ -38,8 +38,10 @@ from _HasGallery import HasGallery from _HasIdOf import HasIdOf from _HasLDS import HasLDS from _RegExpIdOf import RegExpIdOf +from _HasNote import HasNote from _HasNoteRegexp import HasNoteRegexp from _HasNoteMatchingSubstringOf import HasNoteMatchingSubstringOf +from _HasSource import HasSource from _HasReferenceCountOf import HasReferenceCountOf from _FamilyPrivate import FamilyPrivate from _HasAttribute import HasAttribute @@ -60,10 +62,12 @@ editor_rule_list = [ HasGallery, HasIdOf, HasLDS, + HasNote, RegExpIdOf, HasNoteRegexp, HasNoteMatchingSubstringOf, HasReferenceCountOf, + HasSource, FamilyPrivate, HasEvent, HasAttribute, diff --git a/src/Filters/Rules/Person/_HasAddress.py b/src/Filters/Rules/Person/_HasAddress.py index d160c5956..1d9e87fcd 100755 --- a/src/Filters/Rules/Person/_HasAddress.py +++ b/src/Filters/Rules/Person/_HasAddress.py @@ -43,8 +43,8 @@ from Filters.Rules import Rule class HasAddress(Rule): """Rule that checks for a person with a personal address""" - name = _('People with the personal address') - description = _("Matches people with the personal address") + name = _('People with address') + description = _("Matches people with a personal address") category = _('General filters') def apply(self, db, person): diff --git a/src/Filters/Rules/Person/_HasSource.py b/src/Filters/Rules/Person/_HasSource.py new file mode 100755 index 000000000..07e89832f --- /dev/null +++ b/src/Filters/Rules/Person/_HasSource.py @@ -0,0 +1,47 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2002-2007 Donald N. Allingham +# Copyright (C) 2007-2008 Brian G. Matherly +# Copyright (C) 2008 Jerome Rapinat +# Copyright (C) 2008 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 +# + +# $Id: _HasNote.py 9912 2008-01-22 09:17:46Z acraphae $ + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._HasSourceBase import HasSourceBase + +#------------------------------------------------------------------------- +# "People having sources" +#------------------------------------------------------------------------- +class HasSource(HasSourceBase): + """People with sources""" + + name = _('People with source') + description = _("Matches people with a source") diff --git a/src/Filters/Rules/Person/__init__.py b/src/Filters/Rules/Person/__init__.py index 62704a701..beebbf9ff 100644 --- a/src/Filters/Rules/Person/__init__.py +++ b/src/Filters/Rules/Person/__init__.py @@ -47,6 +47,7 @@ from _HasNote import HasNote from _HasNoteMatchingSubstringOf import HasNoteMatchingSubstringOf from _HasNoteRegexp import HasNoteRegexp from _HasRelationship import HasRelationship +from _HasSource import HasSource from _HasSourceOf import HasSourceOf from _HasTextMatchingRegexpOf import HasTextMatchingRegexpOf from _HasTextMatchingSubstringOf import HasTextMatchingSubstringOf @@ -124,6 +125,7 @@ editor_rule_list = [ HasFamilyEvent, HasAttribute, HasFamilyAttribute, + HasSource, HasSourceOf, HasMarkerOf, HaveAltFamilies, diff --git a/src/Filters/Rules/Place/_HasNote.py b/src/Filters/Rules/Place/_HasNote.py new file mode 100755 index 000000000..c52428dc3 --- /dev/null +++ b/src/Filters/Rules/Place/_HasNote.py @@ -0,0 +1,47 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2002-2007 Donald N. Allingham +# Copyright (C) 2007-2008 Brian G. Matherly +# Copyright (C) 2008 Jerome Rapinat +# Copyright (C) 2008 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 +# + +# $Id: _HasNote.py 9912 2008-01-22 09:17:46Z acraphae $ + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._HasNoteBase import HasNoteBase + +#------------------------------------------------------------------------- +# "Places having notes" +#------------------------------------------------------------------------- +class HasNote(HasNoteBase): + """Places having notes""" + + name = _('Places having note') + description = _("Matches places that have a note") diff --git a/src/Filters/Rules/Place/__init__.py b/src/Filters/Rules/Place/__init__.py index 564cfd2ae..8c7eb28ee 100644 --- a/src/Filters/Rules/Place/__init__.py +++ b/src/Filters/Rules/Place/__init__.py @@ -29,6 +29,7 @@ from _AllPlaces import AllPlaces from _HasGallery import HasGallery from _HasIdOf import HasIdOf from _RegExpIdOf import RegExpIdOf +from _HasNote import HasNote from _HasNoteRegexp import HasNoteRegexp from _HasNoteMatchingSubstringOf import HasNoteMatchingSubstringOf from _HasReferenceCountOf import HasReferenceCountOf @@ -44,6 +45,7 @@ editor_rule_list = [ HasGallery, HasIdOf, RegExpIdOf, + HasNote, HasNoteRegexp, HasNoteMatchingSubstringOf, HasReferenceCountOf, diff --git a/src/Filters/Rules/Source/_HasNote.py b/src/Filters/Rules/Source/_HasNote.py new file mode 100755 index 000000000..1bf4093cf --- /dev/null +++ b/src/Filters/Rules/Source/_HasNote.py @@ -0,0 +1,47 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2002-2007 Donald N. Allingham +# Copyright (C) 2007-2008 Brian G. Matherly +# Copyright (C) 2008 Jerome Rapinat +# Copyright (C) 2008 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 +# + +# $Id: _HasNote.py 9912 2008-01-22 09:17:46Z acraphae $ + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._HasNoteBase import HasNoteBase + +#------------------------------------------------------------------------- +# "Sources having notes" +#------------------------------------------------------------------------- +class HasNote(HasNoteBase): + """Sources having notes""" + + name = _('Sources having note') + description = _("Matches sources that have a note") diff --git a/src/Filters/Rules/Source/__init__.py b/src/Filters/Rules/Source/__init__.py index bb2071eb0..092fa2675 100644 --- a/src/Filters/Rules/Source/__init__.py +++ b/src/Filters/Rules/Source/__init__.py @@ -29,6 +29,7 @@ from _AllSources import AllSources from _HasGallery import HasGallery from _HasIdOf import HasIdOf from _RegExpIdOf import RegExpIdOf +from _HasNote import HasNote from _HasNoteRegexp import HasNoteRegexp from _HasNoteMatchingSubstringOf import HasNoteMatchingSubstringOf from _HasReferenceCountOf import HasReferenceCountOf @@ -41,6 +42,7 @@ editor_rule_list = [ HasGallery, HasIdOf, RegExpIdOf, + HasNote, HasNoteRegexp, HasNoteMatchingSubstringOf, HasReferenceCountOf,