forked from gramps-project/addons-source
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New filter rule 'familieswitheventfiltermatch' (gramps-project#274)
* New filter rule 'familieswitheventfiltermatch' Matches families that are matched by an event filter.
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Gramps - a GTK+/GNOME based genealogy program | ||
# | ||
# Copyright (C) 2020 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. | ||
# | ||
|
||
"""Filter rule which matches families that are matched by an event filter.""" | ||
register(RULE, | ||
id = 'familieswitheventfiltermatch', | ||
name = _("Families matching <event filter>"), | ||
description = _("Matches families that are matched by an event filter"), | ||
version = '1.0.0', | ||
authors = ["Matthias Kemmer"], | ||
authors_email = ["[email protected]"], | ||
gramps_target_version = '5.1', | ||
status = STABLE, | ||
fname = "familieswitheventfiltermatch.py", | ||
ruleclass = 'FamiliesWithEventFilterMatch', # must be rule class name | ||
namespace = 'Family', # one of the primary object classes | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# | ||
# Gramps - a GTK+/GNOME based genealogy program | ||
# | ||
# Copyright (C) 2020 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. | ||
# | ||
"""Filter rule for families matching an event filter.""" | ||
|
||
# ------------------------------------------------------------------------- | ||
# | ||
# Gramps modules | ||
# | ||
# ------------------------------------------------------------------------- | ||
from gramps.gen.filters.rules._matcheseventfilterbase import MatchesEventFilterBase | ||
from gramps.gen.const import GRAMPS_LOCALE as glocale | ||
try: | ||
_trans = glocale.get_addon_translator(__file__) | ||
except ValueError: | ||
_trans = glocale.translation | ||
_ = _trans.gettext | ||
|
||
|
||
# ------------------------------------------------------------------------- | ||
# | ||
# IsRelatedWithFilterMatch | ||
# | ||
# ------------------------------------------------------------------------- | ||
class FamiliesWithEventFilterMatch(MatchesEventFilterBase): | ||
"""Rule that checks against an event filter.""" | ||
|
||
labels = [_('Event filter name:')] | ||
name = _('Families matching <event filter>') | ||
category = _("Event filters") | ||
description = _("Matches families matched by an event filter") | ||
namespace = 'Event' |