Add 'HasAttribute' filter rule to repositories, sources and citations

Fixes #9845
This commit is contained in:
Matthias Kemmer 2019-06-01 23:04:15 +02:00 committed by Nick Hall
parent 1eaa609058
commit 5935a315b2
7 changed files with 156 additions and 0 deletions

View File

@ -28,6 +28,7 @@ from ._hascitation import HasCitation
from ._allcitations import AllCitations
from ._changedsince import ChangedSince
from ._citationprivate import CitationPrivate
from ._hasattribute import HasAttribute
from ._hasgallery import HasGallery
from ._hasidof import HasIdOf
from ._hasnote import HasNote
@ -50,6 +51,7 @@ editor_rule_list = [
AllCitations,
ChangedSince,
CitationPrivate,
HasAttribute,
HasGallery,
HasIdOf,
HasNote,

View File

@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2019 Matthias Kemmer
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Standard Python modules
#
# -------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .._hasattributebase import HasAttributeBase
# -------------------------------------------------------------------------
#
# HasAttribute
#
# -------------------------------------------------------------------------
class HasAttribute(HasAttributeBase):
"""Rule that checks for a citation with a particular attribute"""
labels = [_('Citation attribute:'), _('Value:')]
name = _('Citations with the attribute <attribute>')
description = _("Matches citations with the attribute "
"of a particular value")

View File

@ -25,6 +25,7 @@ Package providing filter rules for Gramps.
from ._allrepos import AllRepos
from ._hasidof import HasIdOf
from ._regexpidof import RegExpIdOf
from ._hasattribute import HasAttribute
from ._hasnoteregexp import HasNoteRegexp
from ._hasnotematchingsubstringof import HasNoteMatchingSubstringOf
from ._hasreferencecountof import HasReferenceCountOf
@ -37,6 +38,7 @@ from ._hastag import HasTag
editor_rule_list = [
AllRepos,
HasAttribute,
HasIdOf,
RegExpIdOf,
HasNoteRegexp,

View File

@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2019 Matthias Kemmer
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Standard Python modules
#
# -------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .._hasattributebase import HasAttributeBase
# -------------------------------------------------------------------------
#
# HasAttribute
#
# -------------------------------------------------------------------------
class HasAttribute(HasAttributeBase):
"""Rule that checks for a repository with a particular attribute"""
labels = [_('Repository attribute:'), _('Value:')]
name = _('Repositories with the attribute <attribute>')
description = _("Matches repositories with the attribute "
"of a particular value")

View File

@ -27,6 +27,7 @@ Package providing filter rules for Gramps.
from .._hassourcebase import HasSourceBase as HasSource
from ._allsources import AllSources
from ._hasattribute import HasAttribute
from ._hasgallery import HasGallery
from ._hasidof import HasIdOf
from ._regexpidof import RegExpIdOf
@ -45,6 +46,7 @@ from ._hastag import HasTag
editor_rule_list = [
AllSources,
HasAttribute,
HasGallery,
HasIdOf,
RegExpIdOf,

View File

@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2019 Matthias Kemmer
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# -------------------------------------------------------------------------
#
# Standard Python modules
#
# -------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
# -------------------------------------------------------------------------
#
# Gramps modules
#
# -------------------------------------------------------------------------
from .._hasattributebase import HasAttributeBase
# -------------------------------------------------------------------------
#
# HasAttribute
#
# -------------------------------------------------------------------------
class HasAttribute(HasAttributeBase):
"""Rule that checks for a source with a particular attribute"""
labels = [_('Source attribute:'), _('Value:')]
name = _('Sources with the attribute <attribute>')
description = _("Matches sources with the attribute "
"of a particular value")

View File

@ -47,6 +47,7 @@ gramps/gen/filters/rules/_rule.py
gramps/gen/filters/rules/citation/_allcitations.py
gramps/gen/filters/rules/citation/_changedsince.py
gramps/gen/filters/rules/citation/_citationprivate.py
gramps/gen/filters/rules/citation/_hasattribute.py
gramps/gen/filters/rules/citation/_hascitation.py
gramps/gen/filters/rules/citation/_hasgallery.py
gramps/gen/filters/rules/citation/_hasidof.py
@ -254,6 +255,7 @@ gramps/gen/filters/rules/place/_regexpidof.py
gramps/gen/filters/rules/place/_withinarea.py
gramps/gen/filters/rules/repository/_allrepos.py
gramps/gen/filters/rules/repository/_changedsince.py
gramps/gen/filters/rules/repository/_hasattribute.py
gramps/gen/filters/rules/repository/_hasidof.py
gramps/gen/filters/rules/repository/_hasnotematchingsubstringof.py
gramps/gen/filters/rules/repository/_hasnoteregexp.py
@ -266,6 +268,7 @@ gramps/gen/filters/rules/repository/_regexpidof.py
gramps/gen/filters/rules/repository/_repoprivate.py
gramps/gen/filters/rules/source/_allsources.py
gramps/gen/filters/rules/source/_changedsince.py
gramps/gen/filters/rules/source/_hasattribute.py
gramps/gen/filters/rules/source/_hasgallery.py
gramps/gen/filters/rules/source/_hasidof.py
gramps/gen/filters/rules/source/_hasnote.py