mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Add R_LIBS_USER option for windows
Hopefully a more proper attempt to fix http://hub.qgis.org/issues/11603 directly in processing by means of providing an option to define a path for user libraries on MS Windows. Not sure if this could be useful for other OSes too?
This commit is contained in:
parent
f8ff073dd9
commit
3fcc101446
@ -41,6 +41,7 @@ class RUtils:
|
|||||||
RSCRIPTS_FOLDER = 'R_SCRIPTS_FOLDER'
|
RSCRIPTS_FOLDER = 'R_SCRIPTS_FOLDER'
|
||||||
R_FOLDER = 'R_FOLDER'
|
R_FOLDER = 'R_FOLDER'
|
||||||
R_USE64 = 'R_USE64'
|
R_USE64 = 'R_USE64'
|
||||||
|
R_LIBS_USER = 'R_LIBS_USER'
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def RFolder():
|
def RFolder():
|
||||||
@ -50,6 +51,15 @@ class RUtils:
|
|||||||
|
|
||||||
return os.path.abspath(unicode(folder))
|
return os.path.abspath(unicode(folder))
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def RLibs():
|
||||||
|
folder = ProcessingConfig.getSetting(RUtils.R_LIBS_USER)
|
||||||
|
if folder is None:
|
||||||
|
folder = unicode(os.path.join(userFolder(), 'rlibs'))
|
||||||
|
mkdir(folder)
|
||||||
|
|
||||||
|
return os.path.abspath(unicode(folder))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def RScriptsFolder():
|
def RScriptsFolder():
|
||||||
folder = ProcessingConfig.getSetting(RUtils.RSCRIPTS_FOLDER)
|
folder = ProcessingConfig.getSetting(RUtils.RSCRIPTS_FOLDER)
|
||||||
@ -90,8 +100,9 @@ class RUtils:
|
|||||||
'BATCH',
|
'BATCH',
|
||||||
'--vanilla',
|
'--vanilla',
|
||||||
RUtils.getRScriptFilename(),
|
RUtils.getRScriptFilename(),
|
||||||
RUtils.getConsoleOutputFilename(),
|
RUtils.getConsoleOutputFilename()
|
||||||
]
|
]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
os.chmod(RUtils.getRScriptFilename(), stat.S_IEXEC | stat.S_IREAD
|
os.chmod(RUtils.getRScriptFilename(), stat.S_IEXEC | stat.S_IREAD
|
||||||
| stat.S_IWRITE)
|
| stat.S_IWRITE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user