Skip to content

Commit

Permalink
[processing] fixed wrong call to self.tr from static method
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Oct 7, 2014
1 parent cc8058a commit f661f80
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/plugins/processing/modeler/ModelerAlgorithm.py
Expand Up @@ -38,11 +38,9 @@
from processing.modeler.WrongModelException import WrongModelException
from processing.core.GeoAlgorithmExecutionException import \
GeoAlgorithmExecutionException
from processing.gui.Help2Html import getHtmlFromHelpFile
from processing.modeler.ModelerUtils import ModelerUtils
from processing.core.parameters import *
from processing.tools import dataobjects
from processing.core.parameters import getParameterFromString
from processing.gui.Help2Html import getHtmlFromDescriptionsDict

class ModelerParameter():
Expand Down Expand Up @@ -544,6 +542,8 @@ def fromFile(filename):

@staticmethod
def fromOldFormatFile(filename):
def _tr(s):
return QtCore.QCoreApplication.translate('ModelerAlgorithm', s)
hardcodedValues = {}
modelParameters = []
modelAlgs = []
Expand All @@ -560,7 +560,7 @@ def fromOldFormatFile(filename):
pass
else:
raise WrongModelException(
self.tr('Error in parameter line: %s', 'ModelerAlgorithm') % line)
_tr('Error in parameter line: %s', 'ModelerAlgorithm') % line)
line = lines.readline().strip('\n')
tokens = line.split(',')
model.addParameter(ModelerParameter(param, QtCore.QPointF(
Expand Down Expand Up @@ -623,7 +623,7 @@ def fromOldFormatFile(filename):
modelAlgs.append(modelAlg.name)
else:
raise WrongModelException(
self.tr('Error in algorithm name: %s', 'ModelerAlgorithm') % algLine)
_tr('Error in algorithm name: %s', ) % algLine)
line = lines.readline().strip('\n').strip('\r')
for modelAlg in model.algs.values():
for name, value in modelAlg.params.iteritems():
Expand All @@ -634,4 +634,4 @@ def fromOldFormatFile(filename):
if isinstance(e, WrongModelException):
raise e
else:
raise WrongModelException(self.tr('Error in model definition line: %s\n%s', 'ModelerAlgorithm') % (line.strip(), traceback.format_exc()))
raise WrongModelException(_tr('Error in model definition line: ') + '%s\n%s' % (line.strip(), traceback.format_exc()))

0 comments on commit f661f80

Please sign in to comment.