Skip to content

Commit a23dc9e

Browse files
committedOct 3, 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 ebb6c22 commit a23dc9e

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
@@ -43,6 +43,8 @@ class RUtils:
4343
R_USE64 = 'R_USE64'
4444
R_LIBS_USER = 'R_LIBS_USER'
4545

46+
rscriptfilename = userFolder() + os.sep + 'processing_script.r'
47+
4648
@staticmethod
4749
def RFolder():
4850
folder = ProcessingConfig.getSetting(RUtils.R_FOLDER)
@@ -85,14 +87,17 @@ def createRScriptFromRCommands(commands):
8587

8688
@staticmethod
8789
def getRScriptFilename():
88-
return userFolder() + os.sep + 'processing_script.r'
90+
return RUtils.rscriptfilename
8991

9092
@staticmethod
9193
def getConsoleOutputFilename():
9294
return RUtils.getRScriptFilename() + '.Rout'
9395

9496
@staticmethod
9597
def executeRAlgorithm(alg, progress):
98+
# generate new R script file name in a temp folder
99+
RUtils.rscriptfilename = getTempFilenameInTempFolder('processing_script.r')
100+
# run commands
96101
RUtils.verboseCommands = alg.getVerboseCommands()
97102
RUtils.createRScriptFromRCommands(alg.getFullSetOfRCommands())
98103
if isWindows():

0 commit comments

Comments
 (0)