Skip to content

Commit

Permalink
[processing] don't ask for MSYS folder for GRASS7 (fix #14431)
Browse files Browse the repository at this point in the history
(cherry picked from commit 525194d)
  • Loading branch information
alexbruy committed Apr 13, 2016
1 parent 0bde357 commit 328000e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
Expand Up @@ -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,
Expand All @@ -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)

Expand Down
15 changes: 0 additions & 15 deletions python/plugins/processing/algs/grass7/Grass7Utils.py
Expand Up @@ -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'

Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand Down

0 comments on commit 328000e

Please sign in to comment.