Skip to content

Commit e146fce

Browse files
committedSep 30, 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 3f12636 commit e146fce

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)
@@ -106,14 +108,17 @@ def createRScriptFromRCommands(commands):
106108

107109
@staticmethod
108110
def getRScriptFilename():
109-
return userFolder() + os.sep + 'processing_script.r'
111+
return RUtils.rscriptfilename
110112

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

115117
@staticmethod
116118
def executeRAlgorithm(alg, progress):
119+
# generate new R script file name in a temp folder
120+
RUtils.rscriptfilename = getTempFilenameInTempFolder('processing_script.r')
121+
# run commands
117122
RUtils.verboseCommands = alg.getVerboseCommands()
118123
RUtils.createRScriptFromRCommands(alg.getFullSetOfRCommands())
119124
if isWindows():

0 commit comments

Comments
 (0)
Please sign in to comment.