Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #7307 from rldhont/processing-r-enconde-string-218
[Bugfix][Processing] R script: ParameterString has to be encoding
- Loading branch information
Showing
with
10 additions
and
1 deletion.
-
+10
−1
python/plugins/processing/algs/r/RAlgorithm.py
|
@@ -27,6 +27,7 @@ |
|
|
|
|
|
import os |
|
|
import json |
|
|
import types |
|
|
|
|
|
from qgis.PyQt.QtGui import QIcon |
|
|
|
|
@@ -499,12 +500,20 @@ def getImportCommands(self): |
|
|
commands.append(param.name + '= NULL') |
|
|
else: |
|
|
commands.append(param.name + ' = "' + param.value + '"') |
|
|
elif isinstance(param, (ParameterTableField, ParameterTableMultipleField, ParameterString, |
|
|
elif isinstance(param, (ParameterTableField, ParameterTableMultipleField, |
|
|
ParameterFile)): |
|
|
if param.value is None: |
|
|
commands.append(param.name + '= NULL') |
|
|
else: |
|
|
commands.append(param.name + '="' + param.value + '"') |
|
|
elif isinstance(param, ParameterString): |
|
|
if param.value is None: |
|
|
commands.append(param.name + '= NULL') |
|
|
elif type(param.value) == types.StringType: |
|
|
commands.append(param.name + '="' + param.value + '"') |
|
|
else: |
|
|
c = unicode(param.name) + u'="' + unicode(param.value) + u'"' |
|
|
commands.append(c.encode('utf8')) |
|
|
elif isinstance(param, (ParameterNumber, ParameterSelection)): |
|
|
if param.value is None: |
|
|
commands.append(param.name + '= NULL') |
|
|