Skip to content
Permalink
Browse files
indentation update
  • Loading branch information
jef-n committed Jul 2, 2014
1 parent 7aef548 commit 8871be0afa14e8f9a90da4787a7be57935a81923
Showing with 357 additions and 357 deletions.
  1. +5 −5 python/plugins/fTools/tools/doSelectByLocation.py
  2. +6 −6 python/plugins/processing/algs/lidar/fusion/CanopyModel.py
  3. +5 −5 python/plugins/processing/algs/lidar/fusion/Catalog.py
  4. +1 −1 python/plugins/processing/algs/lidar/fusion/CloudMetrics.py
  5. +1 −1 python/plugins/processing/algs/lidar/fusion/Csv2Grid.py
  6. +2 −2 python/plugins/processing/algs/lidar/fusion/GridMetrics.py
  7. +6 −6 python/plugins/processing/algs/lidar/fusion/GridSurfaceCreate.py
  8. +3 −3 python/plugins/processing/algs/lidar/fusion/PolyClipData.py
  9. +2 −2 python/plugins/processing/algs/lidar/fusion/TinSurfaceCreate.py
  10. +6 −6 python/plugins/processing/algs/qgis/ftools/ExtractByLocation.py
  11. +5 −5 python/plugins/processing/algs/qgis/ftools/SelectByLocation.py
  12. +4 −4 python/plugins/processing/core/Processing.py
  13. +4 −4 python/plugins/processing/gui/HelpEditionDialog.py
  14. +1 −1 python/plugins/processing/modeler/AddModelFromFileAction.py
  15. +9 −9 python/plugins/processing/modeler/CalculatorModelerAlgorithm.py
  16. +108 −108 python/plugins/processing/modeler/ModelerAlgorithm.py
  17. +1 −1 python/plugins/processing/modeler/ModelerAlgorithmProvider.py
  18. +20 −20 python/plugins/processing/modeler/ModelerDialog.py
  19. +7 −7 python/plugins/processing/modeler/ModelerGraphicItem.py
  20. +45 −45 python/plugins/processing/modeler/ModelerParametersDialog.py
  21. +13 −13 python/plugins/processing/modeler/ModelerScene.py
  22. +1 −1 python/plugins/processing/modeler/ModelerUtils.py
  23. +4 −4 python/plugins/processing/modeler/MultilineTextPanel.py
  24. +3 −3 python/plugins/processing/parameters/Parameter.py
  25. +1 −1 src/app/qgsmaptoolselect.cpp
  26. +1 −1 src/app/qgsmaptoolselectfreehand.cpp
  27. +1 −1 src/app/qgsmaptoolselectpolygon.cpp
  28. +1 −1 src/app/qgsmaptoolselectradius.cpp
  29. +1 −1 src/app/qgsmaptoolselectrectangle.cpp
  30. +1 −1 src/core/pal/layer.h
  31. +1 −1 src/core/qgslegendrenderer.cpp
  32. +14 −14 src/core/qgslegendsettings.cpp
  33. +70 −70 src/core/qgslegendsettings.h
  34. +4 −4 src/gui/layertree/qgslayertreemapcanvasbridge.cpp
@@ -85,10 +85,10 @@ def compute(self, inLayer, selLayer, modify, selection):
geom = QgsGeometry()
selectedSet = []
index = ftools_utils.createIndex(inputProvider)

def _points_op(geomA,geomB):
return geomA.intersects(geomB)

def _poly_lines_op(geomA,geomB):
if geomA.disjoint(geomB):
return False
@@ -102,14 +102,14 @@ def _poly_lines_op(geomA,geomB):
intersects |= geomA.overlaps(geomB)
if not intersects and (self.opFlags & self.WITHIN):
intersects |= geomA.contains(geomB)
return intersects
return intersects

def _sp_operator():
if inputLayer.geometryType() == QGis.Point:
return _points_op
else:
return _poly_lines_op

self.opFlags = 0
if self.chkTouches.checkState() == Qt.Checked:
self.opFlags |= self.TOUCH
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-

"""
***************************************************************************
@@ -43,7 +43,7 @@ class CanopyModel(FusionAlgorithm):

INPUT = 'INPUT'
OUTPUT_DTM = 'OUTPUT_DTM'
CELLSIZE = 'CELLSIZE'
CELLSIZE = 'CELLSIZE'
XYUNITS = 'XYUNITS'
ZUNITS = 'ZUNITS'
UNITS = ['Meter', 'Feet']
@@ -57,11 +57,11 @@ class CanopyModel(FusionAlgorithm):
def defineCharacteristics(self):
self.name = 'Canopy Model'
self.group = 'Points'
self.addParameter(ParameterFile(self.INPUT, 'Input las layer'))
self.addParameter(ParameterFile(self.INPUT, 'Input las layer'))
self.addParameter(ParameterNumber(self.CELLSIZE, 'Cellsize', 0, None, 10.0))
self.addParameter(ParameterSelection(self.XYUNITS, 'XY Units', self.UNITS))
self.addParameter(ParameterSelection(self.ZUNITS, 'Z Units', self.UNITS))
self.addOutput(OutputFile(self.OUTPUT_DTM, 'DTM Output Surface', 'dtm'))
self.addOutput(OutputFile(self.OUTPUT_DTM, 'DTM Output Surface', 'dtm'))
ground = ParameterFile(self.GROUND, 'Input ground DTM layer', False, True)
ground.isAdvanced = True
self.addParameter(ground)
@@ -70,7 +70,7 @@ def defineCharacteristics(self):
self.addParameter(median)
smooth = ParameterString(self.SMOOTH, 'Smooth', '', False, True)
smooth.isAdvanced = True
self.addParameter(smooth)
self.addParameter(smooth)
slope = ParameterString(self.SLOPE, 'Slope', '', False, True)
slope.isAdvanced = True
self.addParameter(slope)
@@ -79,7 +79,7 @@ def defineCharacteristics(self):
self.addParameter(class_var)
advance_modifiers = ParameterString(self.ADVANCED_MODIFIERS, 'Additional modifiers', '', False, True)
advance_modifiers.isAdvanced = True
self.addParameter(advance_modifiers)
self.addParameter(advance_modifiers)

def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), 'CanopyModel.exe')]
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-

"""
***************************************************************************
@@ -43,7 +43,7 @@ class Catalog(FusionAlgorithm):
def defineCharacteristics(self):
self.name = 'Catalog'
self.group = 'Points'
self.addParameter(ParameterFile(self.INPUT, 'Input las layer'))
self.addParameter(ParameterFile(self.INPUT, 'Input las layer'))
self.addOutput(OutputFile(self.OUTPUT, 'Output files'))
density = ParameterString(self.DENSITY, 'Density - area, min, max (set blank if not used)', '', False, True)
density.isAdvanced = True
@@ -58,7 +58,7 @@ def defineCharacteristics(self):
advanced_modifiers.isAdvanced = True
self.addParameter(advanced_modifiers)


def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), 'Catalog.exe')]
commands.append('/verbose')
@@ -79,6 +79,6 @@ def processAlgorithm(self, progress):
commands.append(self.getParameterValue(self.INPUT))
else:
FusionUtils.createFileList(files)
commands.append(FusionUtils.tempFileListFilepath())
commands.append(self.getOutputValue(self.OUTPUT))
commands.append(FusionUtils.tempFileListFilepath())
commands.append(self.getOutputValue(self.OUTPUT))
FusionUtils.runFusion(commands, progress)
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-

"""
***************************************************************************
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-

"""
***************************************************************************
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
GridMetrics.py
@@ -86,7 +86,7 @@ def defineCharacteristics(self):
class_var = ParameterString(self.CLASS, 'Class (set blank if not used)', '', False, True)
class_var.isAdvanced = True
self.addParameter(class_var)


def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), 'GridMetrics.exe')]
@@ -61,7 +61,7 @@ def defineCharacteristics(self):
self.addParameter(ParameterFile(self.INPUT, 'Input las layer'))
self.addParameter(ParameterNumber(self.CELLSIZE, 'Cellsize', 0, None, 10.0))
self.addParameter(ParameterSelection(self.XYUNITS, 'XY Units', self.UNITS))
self.addParameter(ParameterSelection(self.ZUNITS, 'Z Units', self.UNITS))
self.addParameter(ParameterSelection(self.ZUNITS, 'Z Units', self.UNITS))
self.addOutput(OutputFile(self.OUTPUT_DTM, 'DTM Output Surface', 'dtm'))
spike = ParameterString(self.SPIKE, 'Spike (set blank if not used)', '', False, True)
spike.isAdvanced = True
@@ -71,19 +71,19 @@ def defineCharacteristics(self):
self.addParameter(median)
smooth = ParameterString(self.SMOOTH, 'Smooth', '', False, True)
smooth.isAdvanced = True
self.addParameter(smooth)
self.addParameter(smooth)
slope = ParameterString(self.SLOPE, 'Slope', '', False, True)
slope.isAdvanced = True
self.addParameter(slope)
self.addParameter(slope)
minimum = ParameterBoolean(self.MINIMUM, 'Minimum (set blank if not used)', False)
minimum.isAdvanced = True
self.addParameter(minimum)
self.addParameter(minimum)
class_var = ParameterString(self.CLASS, 'Class(es)', 2, False, True)
class_var.isAdvanced = True
self.addParameter(class_var)
advance_modifiers = ParameterString(self.ADVANCED_MODIFIERS, 'Additional modifiers', '', False, True)
advance_modifiers.isAdvanced = True
self.addParameter(advance_modifiers)
self.addParameter(advance_modifiers)

def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), 'GridSurfaceCreate.exe')]
@@ -122,5 +122,5 @@ def processAlgorithm(self, progress):
commands.append(self.getParameterValue(self.INPUT))
else:
FusionUtils.createFileList(files)
commands.append(FusionUtils.tempFileListFilepath())
commands.append(FusionUtils.tempFileListFilepath())
FusionUtils.runFusion(commands, progress)
@@ -56,9 +56,9 @@ def defineCharacteristics(self):
## 'field' e 'value' box should appear or get activated if Shape attribute is switched ON
self.addParameter(ParameterString(self.FIELD, 'Shape field index'))
self.addParameter(ParameterString(self.VALUE, "Shape value"))
self.addAdvancedModifiers()
self.addAdvancedModifiers()


def processAlgorithm(self, progress):
commands = [os.path.join(FusionUtils.FusionPath(), 'PolyClipData.exe')]
commands.append('/verbose')
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-

"""
***************************************************************************
@@ -76,5 +76,5 @@ def processAlgorithm(self, progress):
if len(files) == 1:
commands.append(self.getParameterValue(self.INPUT))
else:
commands.extend(files)
commands.extend(files)
FusionUtils.runFusion(commands, progress)
@@ -42,7 +42,7 @@ class ExtractByLocation(GeoAlgorithm):
OVERLAPS = 'OVERLAPS'
WITHIN = 'WITHIN'
OUTPUT = 'OUTPUT'

METHODS = ['creating new selection', 'adding to current selection',
'removing from current selection']
opFlags = 0
@@ -73,10 +73,10 @@ def processAlgorithm(self, progress):
filename = self.getParameterValue(self.INTERSECT)
selectLayer = dataobjects.getObjectFromUri(filename)
index = vector.spatialindex(layer)

def _points_op(geomA,geomB):
return geomA.intersects(geomB)

def _poly_lines_op(geomA,geomB):
if geomA.disjoint(geomB):
return False
@@ -90,14 +90,14 @@ def _poly_lines_op(geomA,geomB):
intersects |= geomA.overlaps(geomB)
if not intersects and (self.opFlags & self.operators['WITHIN']):
intersects |= geomA.contains(geomB)
return intersects
return intersects

def _sp_operator():
if layer.geometryType() == QGis.Point:
return _points_op
else:
return _poly_lines_op

self.opFlags = 0
if self.getParameterValue(self.TOUCHES):
self.opFlags |= self.operators['TOUCHES']
@@ -81,10 +81,10 @@ def processAlgorithm(self, progress):

oldSelection = set(inputLayer.selectedFeaturesIds())
index = vector.spatialindex(inputLayer)

def _points_op(geomA,geomB):
return geomA.intersects(geomB)

def _poly_lines_op(geomA,geomB):
if geomA.disjoint(geomB):
return False
@@ -98,14 +98,14 @@ def _poly_lines_op(geomA,geomB):
intersects |= geomA.overlaps(geomB)
if not intersects and (self.opFlags & self.operators['WITHIN']):
intersects |= geomA.contains(geomB)
return intersects
return intersects

def _sp_operator():
if inputLayer.geometryType() == QGis.Point:
return _points_op
else:
return _poly_lines_op

self.opFlags = 0
if self.getParameterValue(self.TOUCHES):
self.opFlags |= self.operators['TOUCHES']
@@ -138,7 +138,7 @@ def initialize():
Processing.addProvider(SagaAlgorithmProvider())
Processing.addProvider(GrassAlgorithmProvider())
Processing.addProvider(Grass7AlgorithmProvider())
Processing.addProvider(ScriptAlgorithmProvider())
Processing.addProvider(ScriptAlgorithmProvider())
Processing.addProvider(TauDEMAlgorithmProvider())
Processing.addProvider(ModelerAlgorithmProvider())
Processing.modeler.initializeSettings()
@@ -211,7 +211,7 @@ def loadActions():
for action in providerActions:
actions.append(action)
Processing.actions[provider.getName()] = actions

Processing.actions[provider.getName()] = actions

@staticmethod
@@ -256,9 +256,9 @@ def runAlgorithm(algOrName, onFinish, *args):
print 'Error: Algorithm not found\n'
return
alg = alg.getCopy()

if len(args) == 1 and isinstance(args[0], dict):
# Set params by name and try to run the alg even if not all parameter values are provided,
# Set params by name and try to run the alg even if not all parameter values are provided,
# by using the default values instead.
setParams = []
for (name, value) in args[0].items():
@@ -55,11 +55,11 @@ def __init__(self, alg):
helpfile = alg.descriptionFile + '.help'
if os.path.exists(helpfile):
try:
with open(helpfile) as f:
with open(helpfile) as f:
self.descriptions = json.load(f)
except Exception, e:
ProcessingLog.addToLog(ProcessingLog.LOG_WARNING, "Cannot open help file: " + helpfile)
ProcessingLog.addToLog(ProcessingLog.LOG_WARNING, "Cannot open help file: " + helpfile)

self.currentName = self.ALG_DESC
if self.ALG_DESC in self.descriptions:
self.text.setText(self.descriptions[self.ALG_DESC])
@@ -80,7 +80,7 @@ def accept(self):
if self.alg.descriptionFile is not None:
try:
with open(self.alg.descriptionFile + '.help', 'w') as f:
json.dump(self.descriptions, f)
json.dump(self.descriptions, f)
except Exception, e:
QMessageBox.warning(self, 'Error saving help file',
'Help file could not be saved.\n'
@@ -47,7 +47,7 @@ def execute(self):
'*.model')
if filename:
try:
ModelerAlgorithm.fromJsonFile(filename)
ModelerAlgorithm.fromJsonFile(filename)
except WrongModelException:
QtGui.QMessageBox.warning(self.toolbox, "Error reading model", "The selected file does not contain a valid model")
return
@@ -40,7 +40,7 @@
NUMBER = 'NUMBER'
RESULT = 'RESULT'
AVAILABLE_VARIABLES = 10

class CalculatorModelerAlgorithm(GeoAlgorithm):

def defineCharacteristics(self):
@@ -68,10 +68,10 @@ def processAlgorithm(self, progress):

def getCustomModelerParametersDialog(self, modelAlg, algIndex=None):
return CalculatorModelerParametersDialog(self, modelAlg, algIndex)


class CalculatorModelerParametersDialog(ModelerParametersDialog):

def setupUi(self):
self.valueItems = {}
self.dependentItems = {}
@@ -112,21 +112,21 @@ def setupUi(self):
def createAlgorithm(self):
alg = Algorithm('modelertools:calculator')
alg.setName(self.model)
alg.description = "Calculator"
alg.description = "Calculator"

formula = self.formulaText.text()
alg.params[FORMULA] = formula

for i in xrange(AVAILABLE_VARIABLES):
paramname = NUMBER + str(i)
alg.params[paramname] = None

numbers = self.getAvailableValuesOfType(ParameterNumber, OutputNumber)
used = []
for i in range(len(numbers)):
if str(chr(i + 97)) in formula:
used.append(numbers[i])
used.append(numbers[i])

for i, variable in enumerate(used):
paramname = NUMBER + str(i)
alg.params[paramname] = variable
@@ -135,4 +135,4 @@ def createAlgorithm(self):
return alg



0 comments on commit 8871be0

Please sign in to comment.