Skip to content
Permalink
Browse files

[processing] don't ask for MSYS folder for GRASS7 (fix #14431)

(cherry picked from commit 525194d)
  • Loading branch information
alexbruy committed Apr 7, 2016
1 parent 0bde357 commit 328000e0a0f86f20873577699aaad3ecbde25c5f
@@ -52,10 +52,6 @@ def initializeSettings(self):
self.getDescription(),
Grass7Utils.GRASS_FOLDER, self.tr('GRASS7 folder'),
Grass7Utils.grassPath(), valuetype=Setting.FOLDER))
ProcessingConfig.addSetting(Setting(
self.getDescription(),
Grass7Utils.GRASS_WIN_SHELL, self.tr('Msys folder'),
Grass7Utils.grassWinShell(), valuetype=Setting.FOLDER))
ProcessingConfig.addSetting(Setting(
self.getDescription(),
Grass7Utils.GRASS_LOG_COMMANDS,
@@ -69,7 +65,6 @@ def unload(self):
AlgorithmProvider.unload(self)
if isWindows() or isMac():
ProcessingConfig.removeSetting(Grass7Utils.GRASS_FOLDER)
ProcessingConfig.removeSetting(Grass7Utils.GRASS_WIN_SHELL)
ProcessingConfig.removeSetting(Grass7Utils.GRASS_LOG_COMMANDS)
ProcessingConfig.removeSetting(Grass7Utils.GRASS_LOG_CONSOLE)

@@ -45,7 +45,6 @@ class Grass7Utils:
GRASS_REGION_YMAX = 'GRASS7_REGION_YMAX'
GRASS_REGION_CELLSIZE = 'GRASS7_REGION_CELLSIZE'
GRASS_FOLDER = 'GRASS7_FOLDER'
GRASS_WIN_SHELL = 'GRASS7_WIN_SHELL'
GRASS_LOG_COMMANDS = 'GRASS7_LOG_COMMANDS'
GRASS_LOG_CONSOLE = 'GRASS7_LOG_CONSOLE'

@@ -103,24 +102,13 @@ def grassPath():

return folder

@staticmethod
def grassWinShell():
folder = ProcessingConfig.getSetting(Grass7Utils.GRASS_WIN_SHELL)
if not os.path.exists(folder):
folder = None
if folder is None:
folder = os.path.dirname(unicode(QgsApplication.prefixPath()))
folder = os.path.join(folder, 'msys')
return folder

@staticmethod
def grassDescriptionPath():
return os.path.join(os.path.dirname(__file__), 'description')

@staticmethod
def createGrass7Script(commands):
folder = Grass7Utils.grassPath()
shell = Grass7Utils.grassWinShell()

script = Grass7Utils.grassScriptFilename()
gisrc = userFolder() + os.sep + 'processing.gisrc7' # FIXME: use temporary file
@@ -139,9 +127,6 @@ def createGrass7Script(commands):
output = open(script, 'w')
output.write('set HOME=' + os.path.expanduser('~') + '\n')
output.write('set GISRC=' + gisrc + '\n')
output.write('set GRASS_SH=' + shell + '\\bin\\sh.exe\n')
output.write('set PATH=' + shell + os.sep + 'bin;' + shell + os.sep
+ 'lib;' + '%PATH%\n')
output.write('set WINGISBASE=' + folder + '\n')
output.write('set GISBASE=' + folder + '\n')
output.write('set GRASS_PROJSHARE=' + folder + os.sep + 'share'

0 comments on commit 328000e

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