Skip to content
Permalink
Browse files

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

  • Loading branch information
volaya authored and alexbruy committed Apr 6, 2016
1 parent 505c5ee commit dceb1428460764c70a8dc2e7cc7f05fcb224d4f1
@@ -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():
testfolder = os.path.dirname(QgsApplication.prefixPath())
@@ -106,6 +108,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():
testfolder = os.path.dirname(unicode(QgsApplication.prefixPath()))
@@ -104,6 +106,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')
@@ -56,16 +56,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 dceb142

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