Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/ninsbl/QGIS into processi…

…ng-r
  • Loading branch information
alexbruy committed Feb 27, 2016
2 parents 8125f61 + 1ce66b7 commit ab866d98634e5ad1cb8a534cd40328838c5d044a
Showing with 20 additions and 1 deletion.
  1. +20 −1 python/plugins/processing/algs/r/RUtils.py
@@ -47,7 +47,26 @@ class RUtils:
def RFolder():
folder = ProcessingConfig.getSetting(RUtils.R_FOLDER)
if folder is None:
folder = ''
if isWindows():
if "ProgramW6432" in os.environ.keys() and os.path.isdir(os.path.join(os.environ["ProgramW6432"],'R')):
testfolder = os.path.join(os.environ["ProgramW6432"],'R')
elif "PROGRAMFILES(x86)" in os.environ.keys() and os.path.isdir(os.path.join(os.environ["PROGRAMFILES(x86)"],'R')):
testfolder = os.path.join(os.environ["PROGRAMFILES(x86)"],'R')
elif "PROGRAMFILES" in os.environ.keys() and os.path.isdir(os.path.join(os.environ["PROGRAMFILES"],'R')):
testfolder = os.path.join(os.environ["PROGRAMFILES"],'R')
else:
testfolder = 'C:\\R'
if os.path.isdir(testfolder):
subfolders = os.listdir(testfolder)
subfolders.sort(reverse=True)
for subfolder in subfolders:
if subfolder.startswith('R-'):
folder = os.path.join(testfolder, subfolder)
break
else:
folder = ''
else:
folder = ''

return os.path.abspath(unicode(folder))

0 comments on commit ab866d9

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