[processing] indentation update

This commit is contained in:
Alexander Bruy 2016-11-25 09:27:50 +02:00 committed by volaya
parent f002321be1
commit 50a785bdd6
6 changed files with 35 additions and 36 deletions

View File

@ -86,7 +86,6 @@ class FieldsMapper(GeoAlgorithm):
return False
return False
self.addParameter(ParameterFieldsMapping(self.FIELDS_MAPPING,
self.tr('Fields mapping'),
self.INPUT_LAYER))

View File

@ -39,6 +39,7 @@ from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.algs.qgis.ui.RasterCalculatorWidgets import LayersListWidgetWrapper, ExpressionWidgetWrapper
class RasterCalculator(GeoAlgorithm):
LAYERS = 'LAYERS'
@ -56,7 +57,9 @@ class RasterCalculator(GeoAlgorithm):
datatype=dataobjects.TYPE_RASTER,
optional=True,
metadata={'widget_wrapper': LayersListWidgetWrapper}))
class ParameterRasterCalculatorExpression(ParameterString):
def evaluateForModeler(self, value, model):
# print value
for i in list(model.inputs.values()):
@ -86,7 +89,6 @@ class RasterCalculator(GeoAlgorithm):
optional=True))
self.addOutput(OutputRaster(self.OUTPUT, self.tr('Output')))
def processAlgorithm(self, progress):
expression = self.getParameterValue(self.EXPRESSION)
layersValue = self.getParameterValue(self.LAYERS)
@ -123,6 +125,7 @@ class RasterCalculator(GeoAlgorithm):
bbox.combineExtentWith(lyr.extent())
else:
raise GeoAlgorithmExecutionException(self.tr("No layers selected"))
def _cellsize(layer):
return (layer.extent().xMaximum() - layer.extent().xMinimum()) / layer.width()
cellsize = self.getParameterValue(self.CELLSIZE) or min([_cellsize(lyr) for lyr in layersDict.values()])

View File

@ -25,6 +25,7 @@ class ExpressionWidget(BASE, WIDGET):
def doubleClicked(item):
self.text.insertPlainText(self.options[item.text()])
def addButtonText(text):
if any(c for c in text if c.islower()):
self.text.insertPlainText(" %s()" % text)
@ -109,7 +110,6 @@ class LayersListWidgetWrapper(WidgetWrapper):
if self.dialogType == DIALOG_BATCH:
return self.widget.setText(value)
def value(self):
if self.dialogType == DIALOG_STANDARD:
if self.param.datatype == dataobjects.TYPE_FILE:
@ -130,6 +130,3 @@ class LayersListWidgetWrapper(WidgetWrapper):
if len(values) == 0 and not self.param.optional:
raise InvalidParameterValue()
return values

View File

@ -48,6 +48,7 @@ from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools import dataobjects, vector
from processing.algs.help import shortHelp
class GeoAlgorithm(object):
def __init__(self):
@ -132,7 +133,6 @@ class GeoAlgorithm(object):
"""
pass
def getParametersPanel(self, parent):
return ParametersPanel(parent, self)