File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
python/plugins/processing/algs Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -91,11 +91,14 @@ def grassPath():
91
91
folder = None
92
92
if folder is None :
93
93
if isWindows ():
94
- testfolder = os .path .dirname (QgsApplication .prefixPath ())
94
+ if "OSGEO4W_ROOT" in os .environ :
95
+ testfolder = os .path .join (unicode (os .environ ['OSGEO4W_ROOT' ]), "apps" )
96
+ else :
97
+ testfolder = unicode (QgsApplication .prefixPath ())
95
98
testfolder = os .path .join (testfolder , 'grass' )
96
99
if os .path .isdir (testfolder ):
97
100
for subfolder in os .listdir (testfolder ):
98
- if subfolder .startswith ('grass' ):
101
+ if subfolder .startswith ('grass-6 ' ):
99
102
folder = os .path .join (testfolder , subfolder )
100
103
break
101
104
else :
@@ -110,10 +113,10 @@ def grassWinShell():
110
113
folder = ProcessingConfig .getSetting (GrassUtils .GRASS_WIN_SHELL ) or ''
111
114
if not os .path .exists (folder ):
112
115
folder = None
113
- if folder is None :
116
+ if folder is None and GrassUtils . grassPath () :
114
117
folder = os .path .dirname (unicode (QgsApplication .prefixPath ()))
115
118
folder = os .path .join (folder , 'msys' )
116
- return folder
119
+ return folder or ''
117
120
118
121
@staticmethod
119
122
def grassDescriptionPath ():
Original file line number Diff line number Diff line change @@ -88,7 +88,10 @@ def grassPath():
88
88
folder = None
89
89
if folder is None :
90
90
if isWindows ():
91
- testfolder = os .path .dirname (unicode (QgsApplication .prefixPath ()))
91
+ if "OSGEO4W_ROOT" in os .environ :
92
+ testfolder = os .path .join (unicode (os .environ ['OSGEO4W_ROOT' ]), "apps" )
93
+ else :
94
+ testfolder = unicode (QgsApplication .prefixPath ())
92
95
testfolder = os .path .join (testfolder , 'grass' )
93
96
if os .path .isdir (testfolder ):
94
97
for subfolder in os .listdir (testfolder ):
@@ -100,7 +103,7 @@ def grassPath():
100
103
if not os .path .isdir (folder ):
101
104
folder = '/Applications/GRASS-7.0.app/Contents/MacOS'
102
105
103
- return folder
106
+ return folder or ''
104
107
105
108
@staticmethod
106
109
def grassDescriptionPath ():
You can’t perform that action at this time.
0 commit comments