38
38
from processing .modeler .WrongModelException import WrongModelException
39
39
from processing .core .GeoAlgorithmExecutionException import \
40
40
GeoAlgorithmExecutionException
41
- from processing .gui .Help2Html import getHtmlFromHelpFile
42
41
from processing .modeler .ModelerUtils import ModelerUtils
43
42
from processing .core .parameters import *
44
43
from processing .tools import dataobjects
45
- from processing .core .parameters import getParameterFromString
46
44
from processing .gui .Help2Html import getHtmlFromDescriptionsDict
47
45
48
46
class ModelerParameter ():
@@ -544,6 +542,8 @@ def fromFile(filename):
544
542
545
543
@staticmethod
546
544
def fromOldFormatFile (filename ):
545
+ def _tr (s ):
546
+ return QtCore .QCoreApplication .translate ('ModelerAlgorithm' , s )
547
547
hardcodedValues = {}
548
548
modelParameters = []
549
549
modelAlgs = []
@@ -560,7 +560,7 @@ def fromOldFormatFile(filename):
560
560
pass
561
561
else :
562
562
raise WrongModelException (
563
- self . tr ('Error in parameter line: %s' , 'ModelerAlgorithm' ) % line )
563
+ _tr ('Error in parameter line: %s' , 'ModelerAlgorithm' ) % line )
564
564
line = lines .readline ().strip ('\n ' )
565
565
tokens = line .split (',' )
566
566
model .addParameter (ModelerParameter (param , QtCore .QPointF (
@@ -623,7 +623,7 @@ def fromOldFormatFile(filename):
623
623
modelAlgs .append (modelAlg .name )
624
624
else :
625
625
raise WrongModelException (
626
- self . tr ('Error in algorithm name: %s' , 'ModelerAlgorithm' ) % algLine )
626
+ _tr ('Error in algorithm name: %s' , ) % algLine )
627
627
line = lines .readline ().strip ('\n ' ).strip ('\r ' )
628
628
for modelAlg in model .algs .values ():
629
629
for name , value in modelAlg .params .iteritems ():
@@ -634,4 +634,4 @@ def fromOldFormatFile(filename):
634
634
if isinstance (e , WrongModelException ):
635
635
raise e
636
636
else :
637
- raise WrongModelException (self . tr ('Error in model definition line: %s\n %s' , 'ModelerAlgorithm' ) % (line .strip (), traceback .format_exc ()))
637
+ raise WrongModelException (_tr ('Error in model definition line: ' ) + ' %s\n %s' % (line .strip (), traceback .format_exc ()))
0 commit comments