mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
[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.
This commit is contained in:
parent
89d4998510
commit
4feeab85a5
@ -45,6 +45,8 @@ class RUtils(object):
|
|||||||
R_USE64 = 'R_USE64'
|
R_USE64 = 'R_USE64'
|
||||||
R_LIBS_USER = 'R_LIBS_USER'
|
R_LIBS_USER = 'R_LIBS_USER'
|
||||||
|
|
||||||
|
rscriptfilename = userFolder() + os.sep + 'processing_script.r'
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def RFolder():
|
def RFolder():
|
||||||
folder = ProcessingConfig.getSetting(RUtils.R_FOLDER)
|
folder = ProcessingConfig.getSetting(RUtils.R_FOLDER)
|
||||||
@ -108,7 +110,7 @@ class RUtils(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getRScriptFilename():
|
def getRScriptFilename():
|
||||||
return userFolder() + os.sep + 'processing_script.r'
|
return RUtils.rscriptfilename
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getConsoleOutputFilename():
|
def getConsoleOutputFilename():
|
||||||
@ -116,6 +118,9 @@ class RUtils(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def executeRAlgorithm(alg, progress):
|
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.verboseCommands = alg.getVerboseCommands()
|
||||||
RUtils.createRScriptFromRCommands(alg.getFullSetOfRCommands())
|
RUtils.createRScriptFromRCommands(alg.getFullSetOfRCommands())
|
||||||
if isWindows():
|
if isWindows():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user