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 30, 2016
1 parent 174c479 commit 5859d5e
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 @@ -43,6 +43,8 @@ class RUtils:
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 @@ -106,14 +108,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 5859d5e

Please sign in to comment.