Skip to content
Permalink
Browse files

Add R_LIBS_USER option for windows

Hopefully a more proper attempt to fix http://hub.qgis.org/issues/11603 directly in processing by means of providing an option to define a path for user libraries on MS Windows. Not sure if this could be useful for other OSes too?
  • Loading branch information
ninsbl committed May 5, 2015
1 parent f8ff073 commit 3fcc101446e4e0d7205f812669200c208094141b
Showing with 12 additions and 1 deletion.
  1. +12 −1 python/plugins/processing/algs/r/RUtils.py
@@ -41,6 +41,7 @@ class RUtils:
RSCRIPTS_FOLDER = 'R_SCRIPTS_FOLDER'
R_FOLDER = 'R_FOLDER'
R_USE64 = 'R_USE64'
R_LIBS_USER = 'R_LIBS_USER'

@staticmethod
def RFolder():
@@ -50,6 +51,15 @@ def RFolder():

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

@staticmethod
def RLibs():
folder = ProcessingConfig.getSetting(RUtils.R_LIBS_USER)
if folder is None:
folder = unicode(os.path.join(userFolder(), 'rlibs'))
mkdir(folder)

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

@staticmethod
def RScriptsFolder():
folder = ProcessingConfig.getSetting(RUtils.RSCRIPTS_FOLDER)
@@ -90,8 +100,9 @@ def executeRAlgorithm(alg, progress):
'BATCH',
'--vanilla',
RUtils.getRScriptFilename(),
RUtils.getConsoleOutputFilename(),
RUtils.getConsoleOutputFilename()
]

else:
os.chmod(RUtils.getRScriptFilename(), stat.S_IEXEC | stat.S_IREAD
| stat.S_IWRITE)

0 comments on commit 3fcc101

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