Skip to content

Commit

Permalink
Merge pull request #7518 from alexbruy/homogenize-param
Browse files Browse the repository at this point in the history
[processing] homogenize label for "additional creation options" parameter
  • Loading branch information
alexbruy authored Aug 2, 2018
2 parents 62a56b1 + f524460 commit c81c499
Show file tree
Hide file tree
Showing 24 changed files with 24 additions and 45 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ClipRasterByExtent.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def initAlgorithm(self, config=None):
optional=True))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ClipRasterByMask.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ColorRelief.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def initAlgorithm(self, config=None):
options=[i[0] for i in self.modes],
defaultValue=2))
options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/GridAverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/GridDataMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/GridInverseDistance.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/GridLinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/GridNearestNeighbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/aspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
23 changes: 2 additions & 21 deletions python/plugins/processing/algs/gdal/gdalcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

class gdalcalc(GdalAlgorithm):

OPTIONS = 'OPTIONS'
INPUT_A = 'INPUT_A'
INPUT_B = 'INPUT_B'
INPUT_C = 'INPUT_C'
Expand All @@ -57,10 +56,9 @@ class gdalcalc(GdalAlgorithm):
FORMULA = 'FORMULA'
OUTPUT = 'OUTPUT'
NO_DATA = 'NO_DATA'
EXTRA = 'EXTRA'
OPTIONS = 'OPTIONS'
RTYPE = 'RTYPE'
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
#DEBUG = 'DEBUG'

def __init__(self):
super().__init__()
Expand Down Expand Up @@ -149,18 +147,9 @@ def initAlgorithm(self, config=None):
self.tr('Output raster type'),
options=self.TYPE,
defaultValue=5))
#self.addParameter(ParameterBoolean(
# self.DEBUG, self.tr('Print debugging information'), False))
self.addParameter(
QgsProcessingParameterString(
self.EXTRA,
self.tr('Additional creation parameters'),
'',
optional=True))

# advanced raster params
options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down Expand Up @@ -191,10 +180,6 @@ def commandName(self):

def getConsoleCommands(self, parameters, context, feedback, executing=True):
out = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)
extra = self.parameterAsString(parameters, self.EXTRA, context)
# if extra is not None:
# extra = str(extra)
#debug = self.getParameterValue(parameters, self.DEBUG)
formula = self.parameterAsString(parameters, self.FORMULA, context)
if self.NO_DATA in parameters and parameters[self.NO_DATA] is not None:
noData = self.parameterAsDouble(parameters, self.NO_DATA, context)
Expand All @@ -210,10 +195,6 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
if noData is not None:
arguments.append('--NoDataValue')
arguments.append(noData)
if extra and len(extra) > 0:
arguments.append(extra)
#if debug:
# arguments.append('--debug')
layer = self.parameterAsRasterLayer(parameters, self.INPUT_A, context)
if layer is None:
raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT_A))
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/hillshade.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def initAlgorithm(self, config=None):
self.addParameter(nodata_out_param)

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/nearblack.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/proximity.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def initAlgorithm(self, config=None):
optional=True))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/rasterize.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def initAlgorithm(self, config=None):
optional=True))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/retile.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def initAlgorithm(self, config=None):
optional=True))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setMetadata({
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/roughness.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/slope.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/tpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/tri.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def initAlgorithm(self, config=None):
optional=True))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
Expand Down
2 changes: 0 additions & 2 deletions python/plugins/processing/tests/GdalAlgorithmsTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ def testGdalCalc(self):
'NO_DATA': None,
'BAND_F': -1,
'BAND_B': -1,
'EXTRA': '',
'RTYPE': 5,
'INPUT_F': None,
'BAND_E': -1,
Expand All @@ -672,7 +671,6 @@ def testGdalCalc(self):
'NO_DATA': None,
'BAND_F': -1,
'BAND_B': -1,
'EXTRA': '',
'RTYPE': 5,
'INPUT_F': None,
'BAND_E': -1,
Expand Down

0 comments on commit c81c499

Please sign in to comment.