Skip to content
Permalink
Browse files

Merge pull request #3183 from DHI-GRAS/release-2_14

[processing] fixes to GrassUtils and Grass7Utils (mostly cherry-picked jef-n)
  • Loading branch information
alexbruy committed Jun 24, 2016
2 parents a419515 + e94c24d commit 343e177d9831fd1c9029d60ed238af73d20290d6
@@ -91,11 +91,14 @@ def grassPath():
folder = None
if folder is None:
if isWindows():
testfolder = os.path.dirname(QgsApplication.prefixPath())
if "OSGEO4W_ROOT" in os.environ:
testfolder = os.path.join(unicode(os.environ['OSGEO4W_ROOT']), "apps")
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:
@@ -110,10 +113,10 @@ def grassWinShell():
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_WIN_SHELL) or ''
if not os.path.exists(folder):
folder = None
if folder is None:
if folder is None and GrassUtils.grassPath():
folder = os.path.dirname(unicode(QgsApplication.prefixPath()))
folder = os.path.join(folder, 'msys')
return folder
return folder or ''

@staticmethod
def grassDescriptionPath():
@@ -88,7 +88,10 @@ def grassPath():
folder = None
if folder is None:
if isWindows():
testfolder = os.path.dirname(unicode(QgsApplication.prefixPath()))
if "OSGEO4W_ROOT" in os.environ:
testfolder = os.path.join(unicode(os.environ['OSGEO4W_ROOT']), "apps")
else:
testfolder = unicode(QgsApplication.prefixPath())
testfolder = os.path.join(testfolder, 'grass')
if os.path.isdir(testfolder):
for subfolder in os.listdir(testfolder):
@@ -100,7 +103,7 @@ def grassPath():
if not os.path.isdir(folder):
folder = '/Applications/GRASS-7.0.app/Contents/MacOS'

return folder
return folder or ''

@staticmethod
def grassDescriptionPath():

0 comments on commit 343e177

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