Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple parents filter #485

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions FilterRules/multipleparents.gpr.py
@@ -0,0 +1,36 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2021 Davis E Scheipers
#
# 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.
#

"""
People with multiple parent records
"""
register(RULE,
id = 'multipleparents',
name = _("Multiple Parents Filter"),
description = _("Multiple Parents Filter"),
version = '0.0.1',
authors = ["Dave Scheipers"],
authors_email = ["dave.scheipers@gmail.com"],
gramps_target_version = '5.1',
status = STABLE,
fname = "multipleparents.py",
ruleclass = 'MultipleParents', # must be rule class name
namespace = 'Person', # one of the primary object classes
)
47 changes: 47 additions & 0 deletions FilterRules/multipleparents.py
@@ -0,0 +1,47 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext

#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------
from gramps.gen.filters.rules import Rule

#-------------------------------------------------------------------------
# "People with multiple parent records"
#-------------------------------------------------------------------------
class MultipleParents(Rule):
"""People with multiple parent records"""

name = _('People with multiple parent records')
description = _("Matches people who have more than one set of parents")
category = _('Family filters')

def apply(self,db,person):
return len(person.get_parent_family_handle_list()) > 1