Skip to content

Commit

Permalink
[Processing][Rscripts] Use temp script filename
Browse files Browse the repository at this point in the history
The build RScript is stored in the User folder, so the script is erased at each RAlgorithm execute.
Server side or for debugging this could be a problem.
So processing_script.r will be stored in temp folder.
  • Loading branch information
rldhont committed Sep 28, 2016
1 parent 89d4998 commit 4feeab8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/plugins/processing/algs/r/RUtils.py
Expand Up @@ -45,6 +45,8 @@ class RUtils(object):
R_USE64 = 'R_USE64'
R_LIBS_USER = 'R_LIBS_USER'

rscriptfilename = userFolder() + os.sep + 'processing_script.r'

@staticmethod
def RFolder():
folder = ProcessingConfig.getSetting(RUtils.R_FOLDER)
Expand Down Expand Up @@ -108,14 +110,17 @@ def createRScriptFromRCommands(commands):

@staticmethod
def getRScriptFilename():
return userFolder() + os.sep + 'processing_script.r'
return RUtils.rscriptfilename

@staticmethod
def getConsoleOutputFilename():
return RUtils.getRScriptFilename() + '.Rout'

@staticmethod
def executeRAlgorithm(alg, progress):
# generate new R script file name in a temp folder
RUtils.rscriptfilename = getTempFilenameInTempFolder('processing_script.r')
# run commands
RUtils.verboseCommands = alg.getVerboseCommands()
RUtils.createRScriptFromRCommands(alg.getFullSetOfRCommands())
if isWindows():
Expand Down

0 comments on commit 4feeab8

Please sign in to comment.