5621: my bad, call of label(s) and category is not always the same (consistency on children rules); thanks Tim

svn: r19194
This commit is contained in:
Jérôme Rapinat 2012-04-01 10:02:23 +00:00
parent 08581e7ca8
commit 7d4d7735b7
22 changed files with 161 additions and 38 deletions

View File

@ -26,6 +26,7 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
import re
import time
@ -51,7 +52,7 @@ class ChangedSinceBase(Rule):
description = "Matches object records changed after a specified " \
"date/time (yyyy-mm-dd hh:mm:ss) or in range, if a second " \
"date/time is given."
category = 'General filters'
category = _('General filters')
def add_time(self, date):
if re.search("\d.*\s+\d{1,2}:\d{2}:\d{2}", date):

View File

@ -20,6 +20,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -36,7 +43,7 @@ class Everything(Rule):
"""Match Everyone."""
name = 'Every object'
category = 'General filters'
category = _('General filters')
description = 'Matches every object in the database'
def is_empty(self):

View File

@ -20,6 +20,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -42,7 +49,7 @@ class HasAttributeBase(Rule):
name = 'Objects with the <attribute>'
description = "Matches objects with the given attribute " \
"of a particular value"
category = 'General filters'
category = _('General filters')
def apply(self, db, obj):
if not self.list[0]:

View File

@ -21,6 +21,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -46,7 +53,7 @@ class HasCitationBase(Rule):
'Confidence:' ]
name = 'Citations matching parameters'
description = "Matches citations with particular parameters"
category = 'Citation/source filters'
category = _('Citation/source filters')
def prepare(self, db):
self.date = None

View File

@ -20,6 +20,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -46,7 +53,7 @@ class HasEventBase(Rule):
'Main Participants' ]
name = 'Events matching parameters'
description = "Matches events with particular parameters"
category = 'Event filters'
category = _('Event filters')
def prepare(self, db):
self.date = None

View File

@ -23,6 +23,13 @@
# $Id$
#
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -36,10 +43,10 @@ from Filters.Rules import Rule
class HasGalleryBase(Rule):
"""Objects who have Media Object"""
labels = [ 'Number of instances:', 'Number must be:']
labels = [ _('Number of instances:'), _('Number must be:')]
name = 'Object with <count> Media references'
description = "Matches objects with certain number of items in the gallery"
category = 'General filters'
category = _('General filters')
def prepare(self, db):
# things we want to do just once, not for every handle

View File

@ -21,6 +21,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -36,10 +43,10 @@ from Filters.Rules import Rule
class HasGrampsId(Rule):
"""Rule that checks for an object with a specific GRAMPS ID."""
labels = [ 'ID:' ]
labels = [ _('ID:') ]
name = 'Object with <Id>'
description = "Matches objects with a specified Gramps ID"
category = 'General filters'
category = _('General filters')
def apply(self, db, obj):
"""

View File

@ -23,6 +23,13 @@
# $Id$
#
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -39,10 +46,10 @@ from Filters.Rules import Rule
class HasLDSBase(Rule):
"""Rule that checks for object with a LDS event"""
labels = [ 'Number of instances:', 'Number must be:']
labels = [ _('Number of instances:'), _('Number must be:')]
name = 'Objects with LDS events'
description = "Matches objects with LDS events"
category = 'General filters'
category = _('General filters')
def prepare(self, db):
# things we want to do just once, not for every handle

View File

@ -24,6 +24,13 @@
# $Id$
#
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -37,10 +44,10 @@ from Filters.Rules._Rule import Rule
class HasNoteBase(Rule):
"""Objects having notes"""
labels = [ 'Number of instances:', 'Number must be:']
labels = [ _('Number of instances:'), _('Number must be:')]
name = 'Object with notes'
description = "Matches objects that have a certain number of notes"
category = 'General filters'
category = _('General filters')
def __init__(self, arg):
# Upgrade from pre 3.1 HasNote filter, use defaults that correspond

View File

@ -26,6 +26,7 @@
#
#-------------------------------------------------------------------------
import re
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
@ -40,11 +41,11 @@ from Filters.Rules import Rule
class HasNoteRegexBase(Rule):
"""People having notes containing <substring>."""
labels = [ 'Regular expression:']
labels = [ _('Regular expression:')]
name = 'Objects having notes containing <regular expression>'
description = "Matches objects whose notes contain text " \
"matching a regular expression"
category = 'General filters'
category = _('General filters')
def __init__(self, list):
Rule.__init__(self, list)

View File

@ -20,6 +20,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -33,11 +40,11 @@ from Filters.Rules import Rule
class HasNoteSubstrBase(Rule):
"""People having notes containing <substring>."""
labels = [ 'Substring:']
labels = [ _('Substring:')]
name = 'Objects having notes containing <substring>'
description = "Matches objects whose notes contain text matching a " \
"substring"
category = 'General filters'
category = _('General filters')
def apply(self, db, person):
notelist = person.get_note_list()

View File

@ -20,6 +20,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -33,10 +40,10 @@ from Filters.Rules import Rule
class HasReferenceCountBase(Rule):
"""Objects with a reference count of <count>."""
labels = [ 'Reference count must be:', 'Reference count:']
labels = [ _('Reference count must be:'), _('Reference count:')]
name = 'Objects with a reference count of <count>'
description = "Matches objects with a certain reference count"
category = 'General filters'
category = _('General filters')
def prepare(self, db):

View File

@ -21,6 +21,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -43,7 +50,7 @@ class HasSourceBase(Rule):
'Publication:' ]
name = 'Sources matching parameters'
description = "Matches sources with particular parameters"
category = 'Citation/source filters'
category = _('Citation/source filters')
def apply(self,db,source):
if not self.match_substring(0,source.get_title()):

View File

@ -23,6 +23,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -36,11 +43,11 @@ from Filters.Rules._Rule import Rule
class HasSourceCountBase(Rule):
"""Objects having sources"""
labels = [ 'Number of instances:', 'Number must be:']
labels = [ _('Number of instances:'), _('Number must be:')]
name = 'Objects with <count> sources'
description = "Matches objects that have a certain number of sources " \
"connected to it (actually citations are counted)"
category = 'Citation/source filters'
category = _('Citation/source filters')
def prepare(self, db):
# things we want to do just once, not for every handle

View File

@ -22,6 +22,13 @@
Rule that checks for an object with a particular tag.
"""
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -42,7 +49,7 @@ class HasTagBase(Rule):
labels = [ 'Tag:' ]
name = 'Objects with the <tag>'
description = "Matches objects with the given tag"
category = 'General filters'
category = _('General filters')
def prepare(self, db):
"""

View File

@ -20,12 +20,6 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
#
# GRAMPS modules

View File

@ -20,6 +20,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -39,7 +46,7 @@ class HasTextMatchingSubstringOf(Rule):
name = 'Objects with records containing <substring>'
description = "Matches objects whose records contain text " \
"matching a substring"
category = 'General filters'
category = _('General filters')
# FIXME: This needs to be written for an arbitrary object
# if possible

View File

@ -20,6 +20,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -45,7 +52,7 @@ class MatchesEventFilterBase(MatchesFilterBase):
name = 'Objects with events matching the <event filter>'
description = "Matches objects who have events that match a certain" \
" event filter"
category = 'General filters'
category = _('General filters')
# we want to have this filter show event filters
namespace = 'Event'

View File

@ -20,6 +20,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -42,10 +49,10 @@ class MatchesFilterBase(Rule):
"""
labels = ['Filter name:']
labels = [_('Filter name:')]
name = 'Objects matching the <filter>'
description = "Matches objects matched by the specified filter name"
category = 'General filters'
category = _('General filters')
def prepare(self, db):
if Filters.CustomFilters:

View File

@ -24,6 +24,13 @@
# $Id$
#
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -41,7 +48,7 @@ class MatchesSourceConfidenceBase(Rule):
labels = ['Confidence level:']
name = 'Object with at least one direct source >= <confidence level>'
description = "Matches objects with at least one direct source with confidence level(s)"
category = 'Citation/source filters'
category = _('Citation/source filters')
def apply(self, db, obj):
required_conf = int(self.list[0])

View File

@ -21,6 +21,13 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -38,11 +45,11 @@ class MatchesSourceFilterBase(MatchesFilterBase):
Rule that checks against another filter.
"""
labels = ['Source filter name:']
labels = [_('Source filter name:')]
name = 'Objects with source matching the <source filter>'
description = "Matches objects with sources that match the " \
"specified source filter name"
category = 'Citation/source filters'
category = _('Citation/source filters')
# we want to have this filter show source filters
namespace = 'Source'

View File

@ -26,6 +26,7 @@
#
#-------------------------------------------------------------------------
import re
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
@ -44,11 +45,11 @@ class RegExpIdBase(Rule):
Rule that checks for an object whose GRAMPS ID matches regular expression.
"""
labels = [ 'Regular expression:' ]
labels = [ _('Regular expression:') ]
name = 'Objects with <Id>'
description = "Matches objects whose Gramps ID matches " \
"the regular expression"
category = 'General filters'
category = _('General filters')
def __init__(self, list):
Rule.__init__(self, list)