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 Oct 3, 2016
1 parent ebb6c22 commit a23dc9e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/plugins/processing/algs/r/RUtils.py
Original file line number Diff line number Diff line change
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 @@ -85,14 +87,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 a23dc9e

Please sign in to comment.