Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
processing: base grass path on OSGEO4W_ROOT where available
  • Loading branch information
jef-n committed Mar 31, 2016
1 parent 18cdad9 commit ab5f06b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/grass/GrassUtils.py
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion python/plugins/processing/algs/grass7/Grass7Utils.py
Expand Up @@ -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):
Expand Down

0 comments on commit ab5f06b

Please sign in to comment.