Skip to content

Commit a9dab06

Browse files
committedOct 1, 2015
[processing]fixed SAGA when using a version newer than the latest supported one
fixes #13279
1 parent d4cb346 commit a9dab06

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
 

‎python/plugins/processing/algs/saga/SagaAlgorithmProvider.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def _loadAlgorithms(self):
8787
self.tr('Problem with SAGA installation: SAGA was not found or is not correctly installed'))
8888
return
8989
if version not in self.supportedVersions:
90-
if version > self.supportedVersions.keys()[-1]:
91-
version = self.supportedVersions.keys()[-1]
90+
lastVersion = sorted(self.supportedVersions.keys())[-1]
91+
if version > lastVersion:
92+
version = lastVersion
9293
else:
9394
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
9495
self.tr('Problem with SAGA installation: installed SAGA version (%s) is not supported' % version))
@@ -99,12 +100,12 @@ def _loadAlgorithms(self):
99100
for descriptionFile in os.listdir(folder):
100101
if descriptionFile.endswith('txt'):
101102
f = os.path.join(folder, descriptionFile)
102-
self._loadAlgorithm(f)
103+
self._loadAlgorithm(f, version)
103104
self.algs.append(SplitRGBBands())
104105

105-
def _loadAlgorithm(self, descriptionFile):
106+
def _loadAlgorithm(self, descriptionFile, version):
106107
try:
107-
alg = self.supportedVersions[SagaUtils.getSagaInstalledVersion()][1](descriptionFile)
108+
alg = self.supportedVersions[version][1](descriptionFile)
108109
if alg.name.strip() != '':
109110
self.algs.append(alg)
110111
else:

0 commit comments

Comments
 (0)
Please sign in to comment.