Skip to content
Permalink
Browse files

processing: base grass path on OSGEO4W_ROOT where available

  • Loading branch information
jef-n committed Mar 31, 2016
1 parent 18cdad9 commit ab5f06b9fb7083acc45f24fbf7ad3ccbd5da4495
@@ -89,11 +89,14 @@ def grassPath():
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER)
if folder is None:
if isWindows():
testfolder = os.path.dirname(QgsApplication.prefixPath())
if "OSGEO4W_ROOT" in environ:
testfolder = os.path.join(unicode(environ['OSGEO4W_ROOT']), "apps", "grass")
else:
testfolder = unicode(QgsApplication.prefixPath())
testfolder = os.path.join(testfolder, 'grass')
if os.path.isdir(testfolder):
for subfolder in os.listdir(testfolder):
if subfolder.startswith('grass'):
if subfolder.startswith('grass-6'):
folder = os.path.join(testfolder, subfolder)
break
else:
@@ -87,7 +87,10 @@ def grassPath():
folder = ProcessingConfig.getSetting(Grass7Utils.GRASS_FOLDER)
if folder is None:
if isWindows():
testfolder = os.path.dirname(unicode(QgsApplication.prefixPath()))
if "OSGEO4W_ROOT" in environ:
testfolder = os.path.join(unicode(environ['OSGEO4W_ROOT']), "apps", "grass")
else:
testfolder = unicode(QgsApplication.prefixPath())
testfolder = os.path.join(testfolder, 'grass')
if os.path.isdir(testfolder):
for subfolder in os.listdir(testfolder):

0 comments on commit ab5f06b

Please sign in to comment.
You can’t perform that action at this time.