6003: Not all sourcebase objects have the same source filter

svn: r20271
This commit is contained in:
Benny Malengier 2012-08-27 09:39:02 +00:00
parent 091eaea9a6
commit 734b6dff3c
22 changed files with 571 additions and 52 deletions

View File

@ -31,6 +31,7 @@ src/gen/filters/_filterparser.py
# gen.filters.rules package # gen.filters.rules package
src/gen/filters/rules/_everything.py src/gen/filters/rules/_everything.py
src/gen/filters/rules/_hasgrampsid.py src/gen/filters/rules/_hasgrampsid.py
src/gen/filters/rules/_hassourceofbase.py
src/gen/filters/rules/_hastextmatchingsubstringof.py src/gen/filters/rules/_hastextmatchingsubstringof.py
src/gen/filters/rules/_isprivate.py src/gen/filters/rules/_isprivate.py
src/gen/filters/rules/_rule.py src/gen/filters/rules/_rule.py
@ -133,6 +134,7 @@ src/gen/filters/rules/family/_hasnotematchingsubstringof.py
src/gen/filters/rules/family/_hasnoteregexp.py src/gen/filters/rules/family/_hasnoteregexp.py
src/gen/filters/rules/family/_hasreferencecountof.py src/gen/filters/rules/family/_hasreferencecountof.py
src/gen/filters/rules/family/_hasreltype.py src/gen/filters/rules/family/_hasreltype.py
src/gen/filters/rules/family/_hassourceof.py
src/gen/filters/rules/family/_hassourcecount.py src/gen/filters/rules/family/_hassourcecount.py
src/gen/filters/rules/family/_hastag.py src/gen/filters/rules/family/_hastag.py
src/gen/filters/rules/family/_isbookmarked.py src/gen/filters/rules/family/_isbookmarked.py
@ -185,6 +187,10 @@ src/gen/filters/rules/place/_matchesfilter.py
src/gen/filters/rules/place/_matcheseventfilter.py src/gen/filters/rules/place/_matcheseventfilter.py
src/gen/filters/rules/place/_placeprivate.py src/gen/filters/rules/place/_placeprivate.py
src/gen/filters/rules/place/_regexpidof.py src/gen/filters/rules/place/_regexpidof.py
src/gen/filters/rules/place/_hassourceof.py
src/gen/filters/rules/place/_matchessourceconfidence.py
src/gen/filters/rules/place/_hassourcecount.py
src/gen/filters/rules/place/_hascitation.py
# gen.filters.rules.source package # gen.filters.rules.source package
src/gen/filters/rules/source/_allsources.py src/gen/filters/rules/source/_allsources.py
@ -233,6 +239,10 @@ src/gen/filters/rules/media/_hastag.py
src/gen/filters/rules/media/_matchesfilter.py src/gen/filters/rules/media/_matchesfilter.py
src/gen/filters/rules/media/_mediaprivate.py src/gen/filters/rules/media/_mediaprivate.py
src/gen/filters/rules/media/_regexpidof.py src/gen/filters/rules/media/_regexpidof.py
src/gen/filters/rules/media/_hassourcecount.py
src/gen/filters/rules/media/_hassourceof.py
src/gen/filters/rules/media/_matchessourceconfidence.py
src/gen/filters/rules/media/_hascitation.py
# gen.filters.rules.repository package # gen.filters.rules.repository package
src/gen/filters/rules/repository/_allrepos.py src/gen/filters/rules/repository/_allrepos.py

View File

@ -19,6 +19,7 @@ pkgpython_PYTHON = \
_hasreferencecountbase.py \ _hasreferencecountbase.py \
_hassourcecountbase.py \ _hassourcecountbase.py \
_hassourcebase.py \ _hassourcebase.py \
_hassourceofbase.py \
_hastagbase.py \ _hastagbase.py \
_hastextmatchingregexpof.py\ _hastextmatchingregexpof.py\
_hastextmatchingsubstringof.py\ _hastextmatchingsubstringof.py\

View File

@ -47,12 +47,11 @@ class HasCitationBase(Rule):
First parameter is [Volume/page, Date, Confidence] First parameter is [Volume/page, Date, Confidence]
""" """
labels = [ _('Volume/Page:'),
labels = [ 'Volume/Page:', _('Date:'),
'Date:', _('Confidence:') ]
'Confidence:' ] name = _('Citations matching parameters')
name = 'Citations matching parameters' description = _("Matches citations with particular parameters")
description = "Matches citations with particular parameters"
category = _('Citation/source filters') category = _('Citation/source filters')
def prepare(self, db): def prepare(self, db):
@ -63,8 +62,15 @@ class HasCitationBase(Rule):
except: except:
pass pass
def apply(self,db,citation): def apply(self, dbase, object):
if not self.match_substring(0,citation.get_page()): for citation_handle in object.get_citation_list():
citation = dbase.get_citation_from_handle(citation_handle)
if self._apply(dbase, citation):
return True
return False
def _apply(self, db, citation):
if not self.match_substring(0, citation.get_page()):
return False return False
if self.date: if self.date:

View File

@ -0,0 +1,77 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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: _HasSourceOf.py 18548 2011-12-04 17:09:17Z kulath $
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.filters.rules import Rule
#-------------------------------------------------------------------------
#
# HasSourceOf
#
#-------------------------------------------------------------------------
class HasSourceOfBase(Rule):
"""Rule that checks for objects that have a particular source."""
labels = [ _('Source ID:') ]
name = _('Object with the <source>')
category = _('Citation/source filters')
description = _('Matches objects who have a particular source')
def prepare(self,db):
if self.list[0] == '':
self.source_handle = None
self.nosource = True
return
self.nosource = False
try:
self.source_handle = db.get_source_from_gramps_id(
self.list[0]).get_handle()
except:
self.source_handle = None
def apply(self, db, object):
if not self.source_handle:
if self.nosource:
# check whether the citation list is empty as a proxy for
# there being no sources
return len(object.get_all_citation_lists()) == 0
else:
return False
else:
for citation_handle in object.get_all_citation_lists():
citation = db.get_citation_from_handle(citation_handle)
if citation.get_reference_handle() == self.source_handle:
return True
return False

View File

@ -19,6 +19,7 @@ pkgpython_PYTHON = \
_hasreferencecountof.py\ _hasreferencecountof.py\
_hasreltype.py\ _hasreltype.py\
_hassourcecount.py \ _hassourcecount.py \
_hassourceof \
_hastag.py \ _hastag.py \
__init__.py\ __init__.py\
_isbookmarked.py\ _isbookmarked.py\

View File

@ -43,6 +43,7 @@ from _hasnote import HasNote
from _hasnoteregexp import HasNoteRegexp from _hasnoteregexp import HasNoteRegexp
from _hasnotematchingsubstringof import HasNoteMatchingSubstringOf from _hasnotematchingsubstringof import HasNoteMatchingSubstringOf
from _hassourcecount import HasSourceCount from _hassourcecount import HasSourceCount
from _hassourceof import HasSourceOf
from _hasreferencecountof import HasReferenceCountOf from _hasreferencecountof import HasReferenceCountOf
from _hascitation import HasCitation from _hascitation import HasCitation
from _familyprivate import FamilyPrivate from _familyprivate import FamilyPrivate
@ -72,6 +73,7 @@ editor_rule_list = [
HasNoteMatchingSubstringOf, HasNoteMatchingSubstringOf,
HasReferenceCountOf, HasReferenceCountOf,
HasSourceCount, HasSourceCount,
HasSourceOf,
HasCitation, HasCitation,
FamilyPrivate, FamilyPrivate,
HasEvent, HasEvent,

View File

@ -52,10 +52,3 @@ class HasCitation(HasCitationBase):
name = _('Family with the <citation>') name = _('Family with the <citation>')
description = _("Matches families with a citation of a particular " description = _("Matches families with a citation of a particular "
"value") "value")
def apply(self, dbase, family):
for citation_handle in family.get_citation_list():
citation = dbase.get_citation_from_handle(citation_handle)
if HasCitationBase.apply(self, dbase, citation):
return True
return False

View File

@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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: _HasSourceOf.py 18548 2011-12-04 17:09:17Z kulath $
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.filters.rules._hassourceofbase import HasSourceOfBase
#-------------------------------------------------------------------------
#
# HasSourceOf
#
#-------------------------------------------------------------------------
class HasSourceOf(HasSourceOfBase):
"""Rule that checks family that have a particular source."""
labels = [ _('Source ID:') ]
name = _('Families with the <source>')
category = _('Citation/source filters')
description = _('Matches families who have a particular source')

View File

@ -6,13 +6,17 @@ pkgpythondir = $(datadir)/@PACKAGE@/gen/filters/rules/media
pkgpython_PYTHON = \ pkgpython_PYTHON = \
_allmedia.py\ _allmedia.py\
_changedsince.py\ _changedsince.py\
_hascitation.py \
_hasidof.py\ _hasidof.py\
_hasmedia.py\ _hasmedia.py\
_hasnotematchingsubstringof.py\ _hasnotematchingsubstringof.py\
_hasnoteregexp.py\ _hasnoteregexp.py\
_hasreferencecountof.py\ _hasreferencecountof.py\
_hastag.py\ _hastag.py\
_hassourcecount.py \
_hassourceof \
_matchesfilter.py\ _matchesfilter.py\
_matchessourceconfidence.py\
_mediaprivate.py\ _mediaprivate.py\
_hasattribute.py\ _hasattribute.py\
_regexpidof.py\ _regexpidof.py\

View File

@ -27,11 +27,15 @@ Package providing filter rules for GRAMPS.
from _allmedia import AllMedia from _allmedia import AllMedia
from _hasidof import HasIdOf from _hasidof import HasIdOf
from _regexpidof import RegExpIdOf from _regexpidof import RegExpIdOf
from _hascitation import HasCitation
from _hasnoteregexp import HasNoteRegexp from _hasnoteregexp import HasNoteRegexp
from _hasnotematchingsubstringof import HasNoteMatchingSubstringOf from _hasnotematchingsubstringof import HasNoteMatchingSubstringOf
from _hasreferencecountof import HasReferenceCountOf from _hasreferencecountof import HasReferenceCountOf
from _hassourcecount import HasSourceCount
from _hassourceof import HasSourceOf
from _mediaprivate import MediaPrivate from _mediaprivate import MediaPrivate
from _matchesfilter import MatchesFilter from _matchesfilter import MatchesFilter
from _matchessourceconfidence import MatchesSourceConfidence
from _hasmedia import HasMedia from _hasmedia import HasMedia
from _hasattribute import HasAttribute from _hasattribute import HasAttribute
from _changedsince import ChangedSince from _changedsince import ChangedSince
@ -39,13 +43,17 @@ from _hastag import HasTag
editor_rule_list = [ editor_rule_list = [
AllMedia, AllMedia,
HasCitation,
HasIdOf, HasIdOf,
RegExpIdOf, RegExpIdOf,
HasNoteRegexp, HasNoteRegexp,
HasNoteMatchingSubstringOf, HasNoteMatchingSubstringOf,
HasReferenceCountOf, HasReferenceCountOf,
HasSourceCount,
HasSourceOf,
MediaPrivate, MediaPrivate,
MatchesFilter, MatchesFilter,
MatchesSourceConfidence,
HasAttribute, HasAttribute,
ChangedSince, ChangedSince,
HasTag, HasTag,

View File

@ -0,0 +1,53 @@
#
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id: _HasCitation.py 18548 2011-12-04 17:09:17Z kulath $
"""
Filter rule to match persons with a particular citation.
"""
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.filters.rules._hascitationbase import HasCitationBase
#-------------------------------------------------------------------------
#
# HasEvent
#
#-------------------------------------------------------------------------
class HasCitation(HasCitationBase):
"""Rule that checks for a person with a particular value"""
labels = [ _('Volume/Page:'),
_('Date:'),
_('Confidence level:')]
name = _('Media with the <citation>')
description = _("Matches media with a citation of a particular "
"value")

View File

@ -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: _HasSourceCount.py 18548 2011-12-04 17:09:17Z kulath $
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.filters.rules._hassourcecountbase import HasSourceCountBase
#-------------------------------------------------------------------------
# "People having sources"
#-------------------------------------------------------------------------
class HasSourceCount(HasSourceCountBase):
"""Media with sources"""
name = _('Media with <count> sources')
description = _("Matches media with a certain number of sources connected to it")

View File

@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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: _HasSourceOf.py 18548 2011-12-04 17:09:17Z kulath $
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.filters.rules._hassourceofbase import HasSourceOfBase
#-------------------------------------------------------------------------
#
# HasSourceOf
#
#-------------------------------------------------------------------------
class HasSourceOf(HasSourceOfBase):
"""Rule that checks media that have a particular source."""
labels = [ _('Source ID:') ]
name = _('Media with the <source>')
category = _('Citation/source filters')
description = _('Matches media who have a particular source')

View File

@ -0,0 +1,46 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2011 Jerome Rapinat
#
# 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
#
# Filters/Rules/Person/_MatchesSourceConfidence.py
# $Id: _MatchesSourceConfidence.py 18361 2011-10-23 03:13:50Z paul-franklin $
#
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import sgettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.filters.rules._matchessourceconfidencebase import MatchesSourceConfidenceBase
#-------------------------------------------------------------------------
# "Confidence level"
#-------------------------------------------------------------------------
class MatchesSourceConfidence(MatchesSourceConfidenceBase):
"""Media matching a specific confidence level on its 'direct' source references"""
labels = [_('Confidence level:')]
name = _('Media with a direct source >= <confidence level>')
description = _("Matches media with at least one direct source with confidence level(s)")

View File

@ -51,10 +51,3 @@ class HasCitation(HasCitationBase):
name = _('People with the <citation>') name = _('People with the <citation>')
description = _("Matches people with a citation of a particular " description = _("Matches people with a citation of a particular "
"value") "value")
def apply(self, dbase, person):
for citation_handle in person.get_citation_list():
citation = dbase.get_citation_from_handle(citation_handle)
if HasCitationBase.apply(self, dbase, citation):
return True
return False

View File

@ -33,45 +33,17 @@ from gen.ggettext import gettext as _
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gen.filters.rules import Rule from gen.filters.rules._hassourceofbase import HasSourceOfBase
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# HasSourceOf # HasSourceOf
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class HasSourceOf(Rule): class HasSourceOf(HasSourceOfBase):
"""Rule that checks people that have a particular source.""" """Rule that checks people that have a particular source."""
labels = [ _('Source ID:') ] labels = [ _('Source ID:') ]
name = _('People with the <source>') name = _('People with the <source>')
category = _('Citation/source filters') category = _('Citation/source filters')
description = _('Matches people who have a particular source') description = _('Matches people who have a particular source')
def prepare(self,db):
if self.list[0] == '':
self.source_handle = None
self.nosource = True
return
self.nosource = False
try:
self.source_handle = db.get_source_from_gramps_id(
self.list[0]).get_handle()
except:
self.source_handle = None
def apply(self, db, person):
if not self.source_handle:
if self.nosource:
# check whether the citation list is empty as a proxy for
# there being no sources
return len(person.get_all_citation_lists()) == 0
else:
return False
else:
for citation_handle in person.get_all_citation_lists():
citation = db.get_citation_from_handle(citation_handle)
if citation.get_reference_handle() == self.source_handle:
return True
return False

View File

@ -6,6 +6,7 @@ pkgpythondir = $(datadir)/@PACKAGE@/gen/filters/rules/place
pkgpython_PYTHON = \ pkgpython_PYTHON = \
_allplaces.py\ _allplaces.py\
_changedsince.py\ _changedsince.py\
_hascitation.py \
_hasidof.py\ _hasidof.py\
_hasnolatorlon.py\ _hasnolatorlon.py\
_inlatlonneighborhood.py\ _inlatlonneighborhood.py\
@ -15,8 +16,11 @@ pkgpython_PYTHON = \
_hasplace.py\ _hasplace.py\
_hasnote.py \ _hasnote.py \
_hasreferencecountof.py\ _hasreferencecountof.py\
_hassourcecount.py \
_hassourceof \
_matchesfilter.py\ _matchesfilter.py\
_matcheseventfilter.py\ _matcheseventfilter.py\
_matchessourceconfidence.py\
_placeprivate.py\ _placeprivate.py\
_regexpidof.py\ _regexpidof.py\
__init__.py __init__.py

View File

@ -26,6 +26,7 @@ Package providing filter rules for GRAMPS.
""" """
from _allplaces import AllPlaces from _allplaces import AllPlaces
from _hascitation import HasCitation
from _hasgallery import HasGallery from _hasgallery import HasGallery
from _hasidof import HasIdOf from _hasidof import HasIdOf
from _regexpidof import RegExpIdOf from _regexpidof import RegExpIdOf
@ -33,16 +34,20 @@ from _hasnote import HasNote
from _hasnoteregexp import HasNoteRegexp from _hasnoteregexp import HasNoteRegexp
from _hasnotematchingsubstringof import HasNoteMatchingSubstringOf from _hasnotematchingsubstringof import HasNoteMatchingSubstringOf
from _hasreferencecountof import HasReferenceCountOf from _hasreferencecountof import HasReferenceCountOf
from _hassourcecount import HasSourceCount
from _hassourceof import HasSourceOf
from _placeprivate import PlacePrivate from _placeprivate import PlacePrivate
from _matchesfilter import MatchesFilter from _matchesfilter import MatchesFilter
from _hasplace import HasPlace from _hasplace import HasPlace
from _hasnolatorlon import HasNoLatOrLon from _hasnolatorlon import HasNoLatOrLon
from _inlatlonneighborhood import InLatLonNeighborhood from _inlatlonneighborhood import InLatLonNeighborhood
from _matcheseventfilter import MatchesEventFilter from _matcheseventfilter import MatchesEventFilter
from _matchessourceconfidence import MatchesSourceConfidence
from _changedsince import ChangedSince from _changedsince import ChangedSince
editor_rule_list = [ editor_rule_list = [
AllPlaces, AllPlaces,
HasCitation,
HasGallery, HasGallery,
HasIdOf, HasIdOf,
RegExpIdOf, RegExpIdOf,
@ -50,8 +55,11 @@ editor_rule_list = [
HasNoteRegexp, HasNoteRegexp,
HasNoteMatchingSubstringOf, HasNoteMatchingSubstringOf,
HasReferenceCountOf, HasReferenceCountOf,
HasSourceCount,
HasSourceOf,
PlacePrivate, PlacePrivate,
MatchesFilter, MatchesFilter,
MatchesSourceConfidence,
HasPlace, HasPlace,
HasNoLatOrLon, HasNoLatOrLon,
InLatLonNeighborhood, InLatLonNeighborhood,

View File

@ -0,0 +1,54 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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: _HasCitation.py 18548 2011-12-04 17:09:17Z kulath $
"""
Filter rule to match family with a particular citation.
"""
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.filters.rules._hascitationbase import HasCitationBase
#-------------------------------------------------------------------------
#
# HasEvent
#
#-------------------------------------------------------------------------
class HasCitation(HasCitationBase):
"""Rule that checks for a family with a particular value"""
labels = [ _('Volume/Page:'),
_('Date:'),
_('Confidence level:')]
name = _('Place with the <citation>')
description = _("Matches places with a citation of a particular "
"value")

View File

@ -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: _HasSourceCount.py 18548 2011-12-04 17:09:17Z kulath $
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.filters.rules._hassourcecountbase import HasSourceCountBase
#-------------------------------------------------------------------------
# "People having sources"
#-------------------------------------------------------------------------
class HasSourceCount(HasSourceCountBase):
"""Place with sources"""
name = _('Place with <count> sources')
description = _("Matches places with a certain number of sources connected to it")

View File

@ -0,0 +1,49 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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: _HasSourceOf.py 18548 2011-12-04 17:09:17Z kulath $
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.filters.rules._hassourceofbase import HasSourceOfBase
#-------------------------------------------------------------------------
#
# HasSourceOf
#
#-------------------------------------------------------------------------
class HasSourceOf(HasSourceOfBase):
"""Rule that checks family that have a particular source."""
labels = [ _('Source ID:') ]
name = _('Places with the <source>')
category = _('Citation/source filters')
description = _('Matches places who have a particular source')

View File

@ -0,0 +1,46 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2011 Jerome Rapinat
#
# 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
#
# Filters/Rules/Person/_MatchesSourceConfidence.py
# $Id: _MatchesSourceConfidence.py 18361 2011-10-23 03:13:50Z paul-franklin $
#
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import sgettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gen.filters.rules._matchessourceconfidencebase import MatchesSourceConfidenceBase
#-------------------------------------------------------------------------
# "Confidence level"
#-------------------------------------------------------------------------
class MatchesSourceConfidence(MatchesSourceConfidenceBase):
"""Media matching a specific confidence level on its 'direct' source references"""
labels = [_('Confidence level:')]
name = _('Place with a direct source >= <confidence level>')
description = _("Matches places with at least one direct source with confidence level(s)")