mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
[processing] prevent grass installation check returning None when folder not set under windows
This commit is contained in:
parent
1d821d6378
commit
f014b4f097
@ -88,7 +88,7 @@ class GrassUtils:
|
|||||||
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER)
|
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER)
|
||||||
if folder is None:
|
if folder is None:
|
||||||
if isWindows():
|
if isWindows():
|
||||||
testfolder = os.path.dirname(str(QgsApplication.prefixPath()))
|
testfolder = os.path.dirname(QgsApplication.prefixPath())
|
||||||
testfolder = os.path.join(testfolder, 'grass')
|
testfolder = os.path.join(testfolder, 'grass')
|
||||||
if os.path.isdir(testfolder):
|
if os.path.isdir(testfolder):
|
||||||
for subfolder in os.listdir(testfolder):
|
for subfolder in os.listdir(testfolder):
|
||||||
@ -96,12 +96,11 @@ class GrassUtils:
|
|||||||
folder = os.path.join(testfolder, subfolder)
|
folder = os.path.join(testfolder, subfolder)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
folder = os.path.join(str(QgsApplication.prefixPath()), 'grass'
|
folder = os.path.join(QgsApplication.prefixPath(), 'grass')
|
||||||
)
|
|
||||||
if not os.path.isdir(folder):
|
if not os.path.isdir(folder):
|
||||||
folder = '/Applications/GRASS-6.4.app/Contents/MacOS'
|
folder = '/Applications/GRASS-6.4.app/Contents/MacOS'
|
||||||
|
|
||||||
return folder
|
return folder or ''
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def grassWinShell():
|
def grassWinShell():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user