Skip to content

Commit 4feeab8

Browse files
committedSep 28, 2016
[Processing][Rscripts] Use temp script filename
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.
1 parent 89d4998 commit 4feeab8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎python/plugins/processing/algs/r/RUtils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class RUtils(object):
4545
R_USE64 = 'R_USE64'
4646
R_LIBS_USER = 'R_LIBS_USER'
4747

48+
rscriptfilename = userFolder() + os.sep + 'processing_script.r'
49+
4850
@staticmethod
4951
def RFolder():
5052
folder = ProcessingConfig.getSetting(RUtils.R_FOLDER)
@@ -108,14 +110,17 @@ def createRScriptFromRCommands(commands):
108110

109111
@staticmethod
110112
def getRScriptFilename():
111-
return userFolder() + os.sep + 'processing_script.r'
113+
return RUtils.rscriptfilename
112114

113115
@staticmethod
114116
def getConsoleOutputFilename():
115117
return RUtils.getRScriptFilename() + '.Rout'
116118

117119
@staticmethod
118120
def executeRAlgorithm(alg, progress):
121+
# generate new R script file name in a temp folder
122+
RUtils.rscriptfilename = getTempFilenameInTempFolder('processing_script.r')
123+
# run commands
119124
RUtils.verboseCommands = alg.getVerboseCommands()
120125
RUtils.createRScriptFromRCommands(alg.getFullSetOfRCommands())
121126
if isWindows():

0 commit comments

Comments
 (0)
Please sign in to comment.