5621: do not need to call gettext if strings are not used and displayed (TODO: check strings used on sidebar filters)

svn: r19193
This commit is contained in:
Jérôme Rapinat 2012-04-01 06:58:00 +00:00
parent 6c7f3d65bc
commit 08581e7ca8
6 changed files with 28 additions and 58 deletions

View File

@ -26,7 +26,6 @@
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
import re
import time
@ -47,12 +46,12 @@ class ChangedSinceBase(Rule):
Rule that checks for primary objects changed since a specific time.
"""
labels = [ _('Changed after:'), _('but before:') ]
name = _('Objects changed after <date time>')
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')
labels = [ 'Changed after:', 'but before:' ]
name = 'Objects changed after <date time>'
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'
def add_time(self, date):
if re.search("\d.*\s+\d{1,2}:\d{2}:\d{2}", date):

View File

@ -23,13 +23,6 @@
# $Id$
#
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -46,10 +39,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:')]
name = _('Objects with LDS events')
description = _("Matches objects with LDS events")
category = _('General filters')
labels = [ 'Number of instances:', 'Number must be:']
name = 'Objects with LDS events'
description = "Matches objects with LDS events"
category = 'General filters'
def prepare(self, db):
# things we want to do just once, not for every handle

View File

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

View File

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

View File

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

View File

@ -20,13 +20,6 @@
# $Id$
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -40,10 +33,10 @@ from Filters.Rules import Rule
class HasReferenceCountBase(Rule):
"""Objects with a reference count of <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')
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'
def prepare(self, db):