Skip to content
Permalink
Browse files

[processing] extra checks to avoid issues with previous versions values

  • Loading branch information
volaya committed Apr 5, 2016
1 parent 1eb87e5 commit 5131e93e1fe57cc6aff4d2cd1ac51304cfbff742
@@ -87,6 +87,8 @@ def grassPath():
return ''

folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER)
if not os.path.exists(folder):
folder = None
if folder is None:
if isWindows():
if "OSGEO4W_ROOT" in os.environ:
@@ -109,6 +111,8 @@ def grassPath():
@staticmethod
def grassWinShell():
folder = ProcessingConfig.getSetting(GrassUtils.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')
@@ -85,6 +85,8 @@ def grassPath():
return ''

folder = ProcessingConfig.getSetting(Grass7Utils.GRASS_FOLDER)
if not os.path.exists(folder):
folder = None
if folder is None:
if isWindows():
if "OSGEO4W_ROOT" in os.environ:
@@ -107,6 +109,8 @@ def grassPath():
@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')
@@ -76,16 +76,23 @@ def RLibs():
folder = ProcessingConfig.getSetting(RUtils.R_LIBS_USER)
if folder is None:
folder = unicode(os.path.join(userFolder(), 'rlibs'))
mkdir(folder)

try:
mkdir(folder)
except:
folder = unicode(os.path.join(userFolder(), 'rlibs'))
mkdir(folder)
return os.path.abspath(unicode(folder))

@staticmethod
def RScriptsFolder():
folder = ProcessingConfig.getSetting(RUtils.RSCRIPTS_FOLDER)
if folder is None:
folder = unicode(os.path.join(userFolder(), 'rscripts'))
mkdir(folder)
try:
mkdir(folder)
except:
folder = unicode(os.path.join(userFolder(), 'rscripts'))
mkdir(folder)

return os.path.abspath(folder)

0 comments on commit 5131e93

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