mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
processing: improve saga detection on windows
This commit is contained in:
parent
d9abe1e069
commit
0d1ab702fc
@ -67,9 +67,17 @@ def findSagaFolder():
|
||||
if os.path.exists(os.path.join(testfolder, 'saga_cmd')):
|
||||
folder = testfolder
|
||||
elif isWindows():
|
||||
testfolder = os.path.join(os.path.dirname(QgsApplication.prefixPath()), 'saga')
|
||||
if os.path.exists(os.path.join(testfolder, 'saga_cmd.exe')):
|
||||
folder = testfolder
|
||||
folders = []
|
||||
folders.append(os.path.join(os.path.dirname(QgsApplication.prefixPath()), 'saga'))
|
||||
if "OSGEO4W_ROOT" in os.environ:
|
||||
folders.append(os.path.join(str(os.environ['OSGEO4W_ROOT']), "apps", "saga-ltr"))
|
||||
folders.append(os.path.join(str(os.environ['OSGEO4W_ROOT']), "apps", "saga"))
|
||||
|
||||
for testfolder in folders:
|
||||
if os.path.exists(os.path.join(testfolder, 'saga_cmd.exe')):
|
||||
folder = testfolder
|
||||
break
|
||||
|
||||
return folder
|
||||
|
||||
|
||||
@ -161,8 +169,8 @@ def executeSaga(feedback):
|
||||
if isWindows():
|
||||
command = ['cmd.exe', '/C ', sagaBatchJobFilename()]
|
||||
else:
|
||||
os.chmod(sagaBatchJobFilename(), stat.S_IEXEC
|
||||
| stat.S_IREAD | stat.S_IWRITE)
|
||||
os.chmod(sagaBatchJobFilename(), stat.S_IEXEC |
|
||||
stat.S_IREAD | stat.S_IWRITE)
|
||||
command = [sagaBatchJobFilename()]
|
||||
loglines = []
|
||||
loglines.append(QCoreApplication.translate('SagaUtils', 'SAGA execution console output'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user