Skip to content
Permalink
Browse files

[processing] fixed wrong call to self.tr from static method

  • Loading branch information
volaya committed Oct 7, 2014
1 parent cc8058a commit f661f80bdb3089a64bf86a61fa74e6cca3eda0d8
Showing with 5 additions and 5 deletions.
  1. +5 −5 python/plugins/processing/modeler/ModelerAlgorithm.py
@@ -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():
@@ -544,6 +542,8 @@ def fromFile(filename):

@staticmethod
def fromOldFormatFile(filename):
def _tr(s):
return QtCore.QCoreApplication.translate('ModelerAlgorithm', s)
hardcodedValues = {}
modelParameters = []
modelAlgs = []
@@ -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(
@@ -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():
@@ -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.
You can’t perform that action at this time.