Skip to content
Permalink
Browse files
indentation update
  • Loading branch information
jef-n committed May 21, 2014
1 parent 470431d commit 5b2824f788986cf31f6caf4a4cfa1aaa2eae95cc
Showing with 254 additions and 245 deletions.
  1. +3 −3 python/core/contextmanagers.py
  2. +3 −3 python/custom_widgets/qgis_customwidgets.py
  3. +2 −2 python/plugins/processing/algs/admintools/ImportIntoPostGIS.py
  4. +1 −1 python/plugins/processing/algs/gdal/ogr2ogr.py
  5. +32 −32 python/plugins/processing/algs/lidar/lastools/LAStoolsAlgorithm.py
  6. +1 −1 python/plugins/processing/algs/lidar/lastools/blast2iso.py
  7. +1 −1 python/plugins/processing/algs/lidar/lastools/flightlinesToCHM.py
  8. +2 −2 python/plugins/processing/algs/lidar/lastools/flightlinesToSingleCHMpitFree.py
  9. +1 −1 python/plugins/processing/algs/lidar/lastools/las2iso.py
  10. +3 −3 python/plugins/processing/algs/lidar/lastools/las2las.py
  11. +1 −1 python/plugins/processing/algs/lidar/lastools/las2las_filter.py
  12. +1 −1 python/plugins/processing/algs/lidar/lastools/las2las_transform.py
  13. +1 −1 python/plugins/processing/algs/lidar/lastools/las2tin.py
  14. +1 −1 python/plugins/processing/algs/lidar/lastools/lascanopy.py
  15. +1 −1 python/plugins/processing/algs/lidar/lastools/lasclassify.py
  16. +1 −1 python/plugins/processing/algs/lidar/lastools/lasground.py
  17. +1 −1 python/plugins/processing/algs/lidar/lastools/lasmerge.py
  18. +5 −5 python/plugins/processing/algs/lidar/lastools/lasquery.py
  19. +1 −1 python/plugins/processing/algs/lidar/lastools/shp2las.py
  20. +1 −1 python/plugins/processing/algs/lidar/lastools/txt2las.py
  21. +10 −10 python/plugins/processing/algs/saga/RasterCalculator.py
  22. +7 −7 python/plugins/processing/algs/saga/SagaAlgorithm.py
  23. +1 −1 python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
  24. +1 −1 python/plugins/processing/core/GeoAlgorithm.py
  25. +5 −5 python/plugins/processing/gui/MultipleInputDialog.py
  26. +3 −3 python/plugins/processing/modeler/ModelerAlgorithm.py
  27. +4 −4 python/plugins/processing/modeler/ModelerDialog.py
  28. +1 −1 scripts/astyle-all.sh
  29. +73 −73 src/app/legend/qgsapplegendinterface.cpp
  30. +1 −1 src/app/legend/qgsapplegendinterface.h
  31. +6 −6 src/app/qgsapplayertreeviewmenuprovider.h
  32. +11 −11 src/app/qgsprojectlayergroupdialog.cpp
  33. +3 −3 src/core/composer/qgscomposerattributetablemodel.cpp
  34. +2 −2 src/core/qgsmaplayer.cpp
  35. +4 −4 src/core/qgspallabeling.h
  36. +24 −24 src/core/qgsproject.cpp
  37. +2 −2 src/core/qgsproject.h
  38. +1 −1 src/gui/qgsquerybuilder.cpp
  39. +26 −17 src/mapserver/qgswmsserver.cpp
  40. +2 −2 src/providers/mssql/qgsmssqldataitems.cpp
  41. +4 −4 src/providers/mssql/qgsmssqlprovider.cpp
@@ -6,11 +6,11 @@
@contextmanager
def qgisapp(args=None, guienabled=True, configpath=None, sysexit=True):
"""
Create a new QGIS Qt application.
Create a new QGIS Qt application.
You should use this before creating any Qt widgets or QGIS objects for
your custom QGIS based application.
usage:
from qgis.core.contextmanagers import qgisapp
@@ -29,18 +29,18 @@
# pluginType = CW_FILTER
# def getFilter():
# import qgis.gui
#
#
# QGIS_widgets = {}
# for pyClass in dir(qgis.gui):
# QGIS_widgets[pyClass] = 'qgis.gui'
#
#
# def _QGISfilter(widgetname, baseclassname, module):
# print widgetname, baseclassname, module
# if widgetname in QGIS_widgets:
# return (MATCH, (widgetname, baseclassname, QGIS_widgets[widgetname]))
# else:
# return (NO_MATCH, None)
#
#
# return _QGISfilter


@@ -100,14 +100,14 @@ def processAlgorithm(self, progress):
geomColumn = geomColumn.lower()
if dropStringLength:
options['dropStringConstraints'] = True

uri = QgsDataSourceURI()
uri.setConnection(host, str(port), database, username, password)
if primaryKeyField:
uri.setDataSource(schema, table, geomColumn, '', primaryKeyField)
else:
uri.setDataSource(schema, table, geomColumn, '')

layerUri = self.getParameterValue(self.INPUT)
layer = dataobjects.getObjectFromUri(layerUri)
(ret, errMsg) = QgsVectorLayerImport.importLayer(
@@ -68,7 +68,7 @@
'GPX',
'PGDump',
'GPSTrackMaker',
'ODS',
'ODS',
'XLSX',
'PDF',
]
@@ -69,20 +69,20 @@ class LAStoolsAlgorithm(GeoAlgorithm):
FILTER_RETURN_CLASS_FLAGS1 = "FILTER_RETURN_CLASS_FLAGS1"
FILTER_RETURN_CLASS_FLAGS2 = "FILTER_RETURN_CLASS_FLAGS2"
FILTER_RETURN_CLASS_FLAGS3 = "FILTER_RETURN_CLASS_FLAGS3"
FILTERS_RETURN_CLASS_FLAGS = ["---", "keep_last", "keep_first", "keep_middle", "keep_single", "drop_single",
"keep_double", "keep_class 2", "keep_class 2 8", "keep_class 8", "keep_class 6",
FILTERS_RETURN_CLASS_FLAGS = ["---", "keep_last", "keep_first", "keep_middle", "keep_single", "drop_single",
"keep_double", "keep_class 2", "keep_class 2 8", "keep_class 8", "keep_class 6",
"keep_class 9", "keep_class 3 4 5", "keep_class 2 6", "drop_class 7", "drop_withheld"]
FILTER_COORDS_INTENSITY1 = "FILTER_COORDS_INTENSITY1"
FILTER_COORDS_INTENSITY2 = "FILTER_COORDS_INTENSITY2"
FILTER_COORDS_INTENSITY3 = "FILTER_COORDS_INTENSITY3"
FILTER_COORDS_INTENSITY1_ARG = "FILTER_COORDS_INTENSITY1_ARG"
FILTER_COORDS_INTENSITY2_ARG = "FILTER_COORDS_INTENSITY2_ARG"
FILTER_COORDS_INTENSITY3_ARG = "FILTER_COORDS_INTENSITY3_ARG"
FILTERS_COORDS_INTENSITY = ["---", "clip_x_above", "clip_x_below", "clip_y_above", "clip_y_below", "clip_z_above",
"clip_z_below", "drop_intensity_above", "drop_intensity_below", "drop_gps_time_above",
"drop_gps_time_below", "drop_scan_angle_above", "drop_scan_angle_below", "keep_point_source",
"drop_point_source", "drop_point_source_above", "drop_point_source_below", "keep_user_data",
"drop_user_data", "drop_user_data_above", "drop_user_data_below", "keep_every_nth",
FILTERS_COORDS_INTENSITY = ["---", "clip_x_above", "clip_x_below", "clip_y_above", "clip_y_below", "clip_z_above",
"clip_z_below", "drop_intensity_above", "drop_intensity_below", "drop_gps_time_above",
"drop_gps_time_below", "drop_scan_angle_above", "drop_scan_angle_below", "keep_point_source",
"drop_point_source", "drop_point_source_above", "drop_point_source_below", "keep_user_data",
"drop_user_data", "drop_user_data_above", "drop_user_data_below", "keep_every_nth",
"keep_random_fraction", "thin_with_grid" ]

TRANSFORM_COORDINATE1 = "TRANSFORM_COORDINATE1"
@@ -95,8 +95,8 @@ class LAStoolsAlgorithm(GeoAlgorithm):
TRANSFORM_OTHER2 = "TRANSFORM_OTHER2"
TRANSFORM_OTHER1_ARG = "TRANSFORM_OTHER1_ARG"
TRANSFORM_OTHER2_ARG = "TRANSFORM_OTHER2_ARG"
TRANSFORM_OTHERS = ["---", "scale_intensity", "translate_intensity", "clamp_intensity_above", "clamp_intensity_below",
"scale_scan_angle", "translate_scan_angle", "translate_gps_time", "set_classification", "set_user_data",
TRANSFORM_OTHERS = ["---", "scale_intensity", "translate_intensity", "clamp_intensity_above", "clamp_intensity_below",
"scale_scan_angle", "translate_scan_angle", "translate_gps_time", "set_classification", "set_user_data",
"set_point_source", "scale_rgb_up", "scale_rgb_down", "repair_zero_returns" ]

def getIcon(self):
@@ -122,7 +122,7 @@ def addParametersCoresCommands(self, commands):
cores = self.getParameterValue(LAStoolsAlgorithm.CORES)
if cores != 1:
commands.append("-cores")
commands.append(str(cores))
commands.append(str(cores))

def addParametersPointInputGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_LASLAZ, "input LAS/LAZ file"))
@@ -132,7 +132,7 @@ def addParametersPointInputCommands(self, commands):
if input != None:
commands.append("-i")
commands.append(input)

def addParametersPointInputFolderGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_DIRECTORY, "input directory", True))
self.addParameter(ParameterString(LAStoolsAlgorithm.INPUT_WILDCARDS, "input wildcard(s)", "*.laz"))
@@ -168,7 +168,7 @@ def addParametersHorizontalAndVerticalFeetGUI(self):
def addParametersHorizontalAndVerticalFeetCommands(self, commands):
self.addParametersHorizontalFeetCommands(commands)
self.addParametersVerticalFeetCommands(commands)

def addParametersFilesAreFlightlinesGUI(self):
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES, "files are flightlines", True))

@@ -183,11 +183,11 @@ def addParametersStepCommands(self, commands):
step = self.getParameterValue(LAStoolsAlgorithm.STEP)
if step != 0.0:
commands.append("-step")
commands.append(str(step))
commands.append(str(step))

def getParametersStepValue(self):
step = self.getParameterValue(LAStoolsAlgorithm.STEP)
return step
return step

def addParametersPointOutputGUI(self):
self.addOutput(OutputFile(LAStoolsAlgorithm.OUTPUT_LASLAZ, "output LAS/LAZ file", "laz"))
@@ -275,7 +275,7 @@ def addParametersAdditionalCommands(self, commands):
commands.append(option)

def addParametersFilter1ReturnClassFlagsGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS1, "filter (by return, classification, flags)",
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS1, "filter (by return, classification, flags)",
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))

def addParametersFilter1ReturnClassFlagsCommands(self, commands):
@@ -284,7 +284,7 @@ def addParametersFilter1ReturnClassFlagsCommands(self, commands):
commands.append("-" + LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter1])

def addParametersFilter2ReturnClassFlagsGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS2, "second filter (by return, classification, flags)",
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS2, "second filter (by return, classification, flags)",
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))

def addParametersFilter2ReturnClassFlagsCommands(self, commands):
@@ -293,7 +293,7 @@ def addParametersFilter2ReturnClassFlagsCommands(self, commands):
commands.append("-" + LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter2])

def addParametersFilter3ReturnClassFlagsGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS3, "third filter (by return, classification, flags)",
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS3, "third filter (by return, classification, flags)",
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))

def addParametersFilter3ReturnClassFlagsCommands(self, commands):
@@ -302,9 +302,9 @@ def addParametersFilter3ReturnClassFlagsCommands(self, commands):
commands.append("-" + LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter3])

def addParametersFilter1CoordsIntensityGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1, "filter (by coordinate, intensity, GPS time, ...)",
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1, "filter (by coordinate, intensity, GPS time, ...)",
LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1_ARG, "value for filter (by coordinate, intensity, GPS time, ...)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1_ARG, "value for filter (by coordinate, intensity, GPS time, ...)"))

def addParametersFilter1CoordsIntensityCommands(self, commands):
filter1 = self.getParameterValue(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1)
@@ -315,7 +315,7 @@ def addParametersFilter1CoordsIntensityCommands(self, commands):

def addParametersFilter2CoordsIntensityGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2, "second filter (by coordinate, intensity, GPS time, ...)", LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2_ARG, "value for second filter (by coordinate, intensity, GPS time, ...)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2_ARG, "value for second filter (by coordinate, intensity, GPS time, ...)"))

def addParametersFilter2CoordsIntensityCommands(self, commands):
filter2 = self.getParameterValue(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2)
@@ -325,10 +325,10 @@ def addParametersFilter2CoordsIntensityCommands(self, commands):
commands.append(filter2_arg)

def addParametersTransform1CoordinateGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_COORDINATE1,
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_COORDINATE1,
"transform (coordinates)", LAStoolsAlgorithm.TRANSFORM_COORDINATES, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_COORDINATE1_ARG,
"value for transform (coordinates)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_COORDINATE1_ARG,
"value for transform (coordinates)"))

def addParametersTransform1CoordinateCommands(self, commands):
transform1 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_COORDINATE1)
@@ -338,10 +338,10 @@ def addParametersTransform1CoordinateCommands(self, commands):
commands.append(transform1_arg)

def addParametersTransform2CoordinateGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_COORDINATE2,
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_COORDINATE2,
"second transform (coordinates)", LAStoolsAlgorithm.TRANSFORM_COORDINATES, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_COORDINATE2_ARG,
"value for second transform (coordinates)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_COORDINATE2_ARG,
"value for second transform (coordinates)"))

def addParametersTransform2CoordinateCommands(self, commands):
transform2 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_COORDINATE2)
@@ -351,10 +351,10 @@ def addParametersTransform2CoordinateCommands(self, commands):
commands.append(transform2_arg)

def addParametersTransform1OtherGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_OTHER1,
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_OTHER1,
"transform (intensities, scan angles, GPS times, ...)", LAStoolsAlgorithm.TRANSFORM_OTHERS, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_OTHER1_ARG,
"value for transform (intensities, scan angles, GPS times, ...)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_OTHER1_ARG,
"value for transform (intensities, scan angles, GPS times, ...)"))

def addParametersTransform1OtherCommands(self, commands):
transform1 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_OTHER1)
@@ -365,10 +365,10 @@ def addParametersTransform1OtherCommands(self, commands):
commands.append(transform1_arg)

def addParametersTransform2OtherGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_OTHER2,
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_OTHER2,
"second transform (intensities, scan angles, GPS times, ...)", LAStoolsAlgorithm.TRANSFORM_OTHERS, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_OTHER2_ARG,
"value for second transform (intensities, scan angles, GPS times, ...)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_OTHER2_ARG,
"value for second transform (intensities, scan angles, GPS times, ...)"))

def addParametersTransform2OtherCommands(self, commands):
transform2 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_OTHER2)
@@ -52,7 +52,7 @@ def defineCharacteristics(self):
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2iso.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersPointInputCommands(commands)
smooth = self.getParameterValue(blast2iso.SMOOTH)
if smooth != 0:
commands.append("-smooth")
@@ -114,7 +114,7 @@ def processAlgorithm(self, progress):
commands.append("h")
commands.append("-olaz")
self.addParametersCoresCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)

# then we thin and splat the tiles
@@ -96,7 +96,7 @@ def processAlgorithm(self, progress):
commands.append("_g")
commands.append("-olaz")
self.addParametersCoresCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)

# then we height-normalize the tiles
@@ -110,7 +110,7 @@ def processAlgorithm(self, progress):
commands.append("h")
commands.append("-olaz")
self.addParametersCoresCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)

# then we thin and splat the tiles
@@ -56,7 +56,7 @@ def defineCharacteristics(self):
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2iso.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersPointInputCommands(commands)
smooth = self.getParameterValue(las2iso.SMOOTH)
if smooth != 0:
commands.append("-smooth")
@@ -35,8 +35,8 @@ class las2las(LAStoolsAlgorithm):
STEP = "STEP"
OPERATION = "OPERATION"
OPERATIONS = ["---", "set_point_type", "set_point_size", "set_version_minor", "set_version_major",
"start_at_point", "stop_at_point", "remove_vlr", "auto_reoffset", "week_to_adjusted",
"adjusted_to_week", "scale_rgb_up", "scale_rgb_down", "remove_all_vlrs", "remove_extra",
"start_at_point", "stop_at_point", "remove_vlr", "auto_reoffset", "week_to_adjusted",
"adjusted_to_week", "scale_rgb_up", "scale_rgb_down", "remove_all_vlrs", "remove_extra",
"clip_to_bounding_box"]
OPERATIONARG = "OPERATIONARG"

@@ -63,7 +63,7 @@ def processAlgorithm(self, progress):
commands.append("-" + OPERATIONS[operation])
if operation > 7:
commands.append(self.getParameterValue(las2las.OPERATIONARG))

self.addParametersPointOutputCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)
@@ -50,7 +50,7 @@ def processAlgorithm(self, progress):
self.addParametersFilter2ReturnClassFlagsCommands(commands)
self.addParametersFilter1CoordsIntensityCommands(commands)
self.addParametersFilter2CoordsIntensityCommands(commands)

self.addParametersPointOutputCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)
@@ -63,7 +63,7 @@ def processAlgorithm(self, progress):
commands.append("-" + las2las_transform.OPERATIONS[operation])
if operation > 7:
commands.append(self.getParameterValue(las2las_transform.OPERATIONARG))

self.addParametersPointOutputCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)
@@ -46,7 +46,7 @@ def defineCharacteristics(self):
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2tin.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
self.addParametersVectorOutputCommands(commands)

@@ -45,7 +45,7 @@ class lascanopy(LAStoolsAlgorithm):
PRODUCT7 = "PRODUCT7"
PRODUCT8 = "PRODUCT8"
PRODUCT9 = "PRODUCT9"
PRODUCTS = ["---", "min", "max", "avg", "std", "ske", "kur", "cov", "dns",
PRODUCTS = ["---", "min", "max", "avg", "std", "ske", "kur", "cov", "dns",
"p01", "p05", "p10", "p25", "p50", "p75", "p90", "p99"]
COUNTS = "COUNTS"
DENSITIES = "DENSITIES"
@@ -45,7 +45,7 @@ def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclassify.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersHorizontalAndVerticalFeetCommands(commands)
self.addParametersHorizontalAndVerticalFeetCommands(commands)
self.addParametersPointOutputCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)

0 comments on commit 5b2824f

Please sign in to comment.