Skip to content
Permalink
Browse files

indentation update and a few fixed typos

  • Loading branch information
jef-n committed Oct 24, 2013
1 parent 8fb20f0 commit ec0f0bea284b7dd546bd6390375b92286c156d9c
Showing with 240 additions and 231 deletions.
  1. +4 −4 python/console/console_settings.py
  2. +4 −4 python/plugins/processing/algs/SaveSelectedFeatures.py
  3. +8 −8 python/plugins/processing/algs/ftools/ExtractByLocation.py
  4. +6 −6 python/plugins/processing/algs/ftools/RandomExtract.py
  5. +9 −9 python/plugins/processing/algs/ftools/RandomExtractWithinSubsets.py
  6. +1 −1 python/plugins/processing/algs/ftools/SelectByLocation.py
  7. +9 −9 python/plugins/processing/algs/mmqgisx/MMQGISXAlgorithms.py
  8. +2 −2 python/plugins/processing/core/GeoAlgorithm.py
  9. +1 −1 python/plugins/processing/core/SilentProgress.py
  10. +1 −1 python/plugins/processing/gdal/gdaladdo.py
  11. +1 −1 python/plugins/processing/gdal/information.py
  12. +2 −2 python/plugins/processing/gdal/ogr2ogr.py
  13. +2 −2 python/plugins/processing/gdal/ogrinfo.py
  14. +1 −1 python/plugins/processing/gdal/polygonize.py
  15. +1 −1 python/plugins/processing/gdal/proximity.py
  16. +1 −1 python/plugins/processing/gdal/rasterize.py
  17. +1 −1 python/plugins/processing/gdal/translate.py
  18. +1 −1 python/plugins/processing/grass/GrassAlgorithm.py
  19. +2 −2 python/plugins/processing/gui/AlgorithmExecutionDialog.py
  20. +1 −1 python/plugins/processing/gui/HelpEditionDialog.py
  21. +2 −2 python/plugins/processing/gui/MessageBarProgress.py
  22. +2 −2 python/plugins/processing/modeler/ModelerAlgorithm.py
  23. +13 −12 src/app/legend/qgslegend.cpp
  24. +2 −2 src/app/legend/qgslegend.h
  25. +6 −6 src/app/legend/qgslegendlayer.cpp
  26. +1 −1 src/app/qgisapp.cpp
  27. +1 −1 src/app/qgsclipboard.h
  28. +1 −1 src/app/qgsguivectorlayertools.h
  29. +1 −1 src/app/qgslabelengineconfigdialog.cpp
  30. +1 −1 src/app/qgsoptions.cpp
  31. +2 −2 src/core/composer/qgscomposerlegend.cpp
  32. +8 −8 src/core/composer/qgslegendmodel.cpp
  33. +1 −1 src/core/composer/qgslegendmodel.h
  34. +4 −4 src/core/pal/labelposition.cpp
  35. +1 −1 src/core/pal/labelposition.h
  36. +5 −5 src/core/pal/pal.cpp
  37. +5 −5 src/core/pal/pal.h
  38. +2 −2 src/core/qgspallabeling.cpp
  39. +1 −1 src/core/qgspallabeling.h
  40. +1 −1 src/core/raster/qgsrasterdataprovider.h
  41. +2 −1 src/core/symbology-ng/qgsrulebasedrendererv2.cpp
  42. +1 −1 src/gui/qgscomposerview.cpp
  43. +1 −1 src/mapserver/qgsprojectparser.cpp
  44. +4 −2 src/mapserver/qgswmsserver.cpp
  45. +48 −43 src/providers/wms/qgswmsprovider.cpp
  46. +5 −5 src/providers/wms/qgswmsprovider.h
  47. +11 −11 tests/src/core/testqgsmaplayer.cpp
  48. +12 −12 tests/src/core/testqgsrasterlayer.cpp
  49. +30 −30 tests/src/core/testqgsvectorlayer.cpp
  50. +2 −2 tests/src/python/qgis_local_server.py
  51. +1 −1 tests/src/python/qgis_local_server_spawn/flup/server/ajp.py
  52. +4 −4 tests/src/python/test_qgspallabeling_base.py
  53. +1 −1 tests/src/python/test_qgspallabeling_tests.py
@@ -206,7 +206,7 @@ def saveSettings(self):
settings.setValue("pythonConsole/caretLineColor", self.caretLineColor.color())
settings.setValue("pythonConsole/caretLineColorEditor", self.caretLineColorEditor.color())
settings.setValue("pythonConsole/stderrFontColor", self.stderrFontColor.color())

settings.setValue("pythonConsole/singleQuoteFontColor", self.singleQuoteFontColor.color())
settings.setValue("pythonConsole/singleQuoteFontColorEditor", self.singleQuoteFontColorEditor.color())
settings.setValue("pythonConsole/doubleQuoteFontColor", self.doubleQuoteFontColor.color())
@@ -215,7 +215,7 @@ def saveSettings(self):
settings.setValue("pythonConsole/tripleSingleQuoteFontColorEditor", self.tripleSingleQuoteFontColorEditor.color())
settings.setValue("pythonConsole/tripleDoubleQuoteFontColor", self.tripleDoubleQuoteFontColor.color())
settings.setValue("pythonConsole/tripleDoubleQuoteFontColorEditor", self.tripleDoubleQuoteFontColorEditor.color())

def restoreSettings(self):
settings = QSettings()
self.spinBox.setValue(settings.value("pythonConsole/fontsize", 10, type=int))
@@ -285,7 +285,7 @@ def restoreSettings(self):
self.cursorColor.setColor(QColor(settings.value("pythonConsole/cursorColor", QColor(Qt.black))))
self.cursorColorEditor.setColor(QColor(settings.value("pythonConsole/cursorColorEditor", QColor(Qt.black))))
self.stderrFontColor.setColor(QColor(settings.value("pythonConsole/stderrFontColor", QColor(Qt.red))))

self.singleQuoteFontColor.setColor(settings.value("pythonConsole/singleQuoteFontColor", QColor(Qt.blue)))
self.singleQuoteFontColorEditor.setColor(settings.value("pythonConsole/singleQuoteFontColorEditor", QColor(Qt.blue)))
self.doubleQuoteFontColor.setColor(settings.value("pythonConsole/doubleQuoteFontColor", QColor(Qt.blue)))
@@ -311,7 +311,7 @@ def _resetFontColor(self):
self.doubleQuoteFontColor.setColor(QColor(Qt.blue))
self.tripleSingleQuoteFontColor.setColor(QColor(Qt.blue))
self.tripleDoubleQuoteFontColor.setColor(QColor(Qt.blue))


def _resetFontColorEditor(self):
self.defaultFontColorEditor.setColor(QColor(Qt.black))
@@ -121,8 +121,8 @@ def processAlgorithm(self, progress):
# toolbox. The self.crs variable has to be changed in case this
# is not true, or in case there are no input layer from which
# the output crs can be infered


provider = vectorLayer.dataProvider()

writer = output.getVectorWriter(provider.fields(),
@@ -131,12 +131,12 @@ def processAlgorithm(self, progress):
# Now we take the selected features and add them to the output
# layer
features = vector.features(vectorLayer)
total = len(features)
total = len(features)
for (i, feat) in enumerate(features):
writer.addFeature(feat)

# We use the progress object to communicate with the user
progress.setPercentage(100 * i / float(total))
progress.setPercentage(100 * i / float(total))
del writer

# There is nothing more to do here. We do not have to open the
@@ -36,10 +36,10 @@
class ExtractByLocation(GeoAlgorithm):

INPUT = 'INPUT'
INTERSECT = 'INTERSECT'
INTERSECT = 'INTERSECT'
OUTPUT = 'OUTPUT'

def defineCharacteristics(self):
def defineCharacteristics(self):
self.name = 'Extract by location'
self.group = 'Vector selection tools'
self.addParameter(ParameterVector(self.INPUT, 'Layer to select from',
@@ -55,7 +55,7 @@ def processAlgorithm(self, progress):
filename = self.getParameterValue(self.INTERSECT)
selectLayer = dataobjects.getObjectFromUri(filename)
index = vector.spatialindex(layer)

geom = QgsGeometry()
selectedSet = []
current = 0
@@ -70,15 +70,15 @@ def processAlgorithm(self, progress):
feat = layer.getFeatures(request).next()
tmpGeom = QgsGeometry(feat.geometry())
if geom.intersects(tmpGeom):
selectedSet.append(feat.id())
selectedSet.append(feat.id())
progress.setPercentage(int(current * total))

output = self.getOutputFromName(self.OUTPUT)
output = self.getOutputFromName(self.OUTPUT)
writer = output.getVectorWriter(layer.fields(),
layer.geometryType(), layer.crs())

for (i, feat) in enumerate(features):
if feat.id() in selectedSet:
writer.addFeature(feat)
progress.setPercentage(100 * i / float(featureCount))
writer.addFeature(feat)
progress.setPercentage(100 * i / float(featureCount))
del writer
@@ -49,7 +49,7 @@ class RandomExtract(GeoAlgorithm):

METHODS = ['Number of selected features',
'Percentage of selected features']
def defineCharacteristics(self):
def defineCharacteristics(self):
self.name = 'Random extract'
self.group = 'Vector selection tools'

@@ -69,7 +69,7 @@ def processAlgorithm(self, progress):

features = vector.features(layer)
featureCount = len(features)
value = int(self.getParameterValue(self.NUMBER))
value = int(self.getParameterValue(self.NUMBER))

if method == 0:
if value > featureCount:
@@ -85,12 +85,12 @@ def processAlgorithm(self, progress):

selran = random.sample(xrange(0, featureCount), value)

output = self.getOutputFromName(self.OUTPUT)
output = self.getOutputFromName(self.OUTPUT)
writer = output.getVectorWriter(layer.fields(),
layer.geometryType(), layer.crs())

for (i, feat) in enumerate(features):
if i in selran:
writer.addFeature(feat)
progress.setPercentage(100 * i / float(featureCount))
writer.addFeature(feat)
progress.setPercentage(100 * i / float(featureCount))
del writer
@@ -50,7 +50,7 @@ class RandomExtractWithinSubsets(GeoAlgorithm):
METHODS = ['Number of selected features',
'Percentage of selected features']

def defineCharacteristics(self):
def defineCharacteristics(self):
self.name = 'Random extract within subsets'
self.group = 'Vector selection tools'

@@ -72,12 +72,12 @@ def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(filename)
field = self.getParameterValue(self.FIELD)
method = self.getParameterValue(self.METHOD)

index = layer.fieldNameIndex(field)

features = vector.features(layer)
featureCount = len(features)
unique = vector.getUniqueValues(layer, index)
unique = vector.getUniqueValues(layer, index)
value = int(self.getParameterValue(self.NUMBER))
if method == 0:
if value > featureCount:
@@ -92,11 +92,11 @@ def processAlgorithm(self, progress):
value = value / 100.0


output = self.getOutputFromName(self.OUTPUT)
output = self.getOutputFromName(self.OUTPUT)
writer = output.getVectorWriter(layer.fields(),
layer.geometryType(), layer.crs())
selran = []

selran = []
current = 0
total = 100.0 / float(featureCount * len(unique))
features = vector.features(layer)
@@ -129,6 +129,6 @@ def processAlgorithm(self, progress):
features = vector.features(layer)
for (i, feat) in enumerate(features):
if i in selran:
writer.addFeature(feat)
progress.setPercentage(100 * i / float(featureCount))
writer.addFeature(feat)
progress.setPercentage(100 * i / float(featureCount))
del writer
@@ -67,7 +67,7 @@ def processAlgorithm(self, progress):

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

geom = QgsGeometry()
selectedSet = []
current = 0
@@ -1098,7 +1098,7 @@ def processAlgorithm(self, progress):

layer.setSelectedFeatures(selected)
self.setOutputValue(self.RESULT, filename)

class mmqgisx_extract_algorithm(GeoAlgorithm):

LAYERNAME = 'LAYERNAME'
@@ -1107,7 +1107,7 @@ class mmqgisx_extract_algorithm(GeoAlgorithm):
COMPARISON = 'COMPARISON'
RESULT = 'RESULT'

def defineCharacteristics(self):
def defineCharacteristics(self):
self.name = 'Extract by attribute'
self.group = 'Vector selection tools'

@@ -1142,19 +1142,19 @@ def processAlgorithm(self, progress):
comparisonvalue = self.getParameterValue(self.COMPARISONVALUE)

selected = select(layer, attribute, comparison, comparisonvalue, progress)

features = vector.features(layer)
featureCount = len(features)
output = self.getOutputFromName(self.OUTPUT)
output = self.getOutputFromName(self.OUTPUT)
writer = output.getVectorWriter(layer.fields(),
layer.geometryType(), layer.crs())
for (i, feat) in enumerate(features):
if feat.id() in selected:
writer.addFeature(feat)
progress.setPercentage(100 * i / float(featureCount))
del writer
writer.addFeature(feat)
progress.setPercentage(100 * i / float(featureCount))
del writer

def select(layer, attribute, comparison, comparisonvalue, progress):
def select(layer, attribute, comparison, comparisonvalue, progress):
selectindex = layer.dataProvider().fieldNameIndex(attribute)
selectType = layer.dataProvider().fields()[selectindex].type()
selectionError = False
@@ -1263,7 +1263,7 @@ def select(layer, attribute, comparison, comparisonvalue, progress):
selected.append(feature.id())

progress.setPercentage(float(readcount) / totalcount * 100)

return selected

class mmqgisx_text_to_float_algorithm(GeoAlgorithm):
@@ -71,8 +71,8 @@ def __init__(self):
# appear in the toolbox or modeler
self.showInToolbox = True
self.showInModeler = True
#if true, will show only loaded layers in parameters dialog.
#Also, if True, the algorithm does not run on the modeler
#if true, will show only loaded layers in parameters dialog.
#Also, if True, the algorithm does not run on the modeler
#or batch ptocessing interface
self.allowOnlyOpenedLayers = False

@@ -30,7 +30,7 @@ class SilentProgress:

def error(self, msg):
print msg

def setText(self, text):
pass

@@ -64,7 +64,7 @@ class gdaladdo(GeoAlgorithm):
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/raster-overview.png'
return QtGui.QIcon(filepath)

def commandLineName(self):
return "gdalogr:overviews"

@@ -44,7 +44,7 @@ class information(GeoAlgorithm):
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/raster-info.png'
return QtGui.QIcon(filepath)

def commandLineName(self):
return "gdalorg:rasterinfo"

@@ -110,10 +110,10 @@ def defineCharacteristics(self):
''))

self.addOutput(OutputVector(self.OUTPUT_LAYER, 'Output layer'))

def commandLineName(self):
return "gdalogr:ogr2ogr"


def processAlgorithm(self, progress):
if not gdalAvailable:
@@ -56,9 +56,9 @@ def defineCharacteristics(self):
[ParameterVector.VECTOR_TYPE_ANY], False))

self.addOutput(OutputHTML(self.OUTPUT, 'Layer information'))

def commandLineName(self):
return "gdalogr:vectorinfo"
return "gdalogr:vectorinfo"

def processAlgorithm(self, progress):

@@ -44,7 +44,7 @@ class polygonize(GeoAlgorithm):
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/polygonize.png'
return QtGui.QIcon(filepath)

def commandLineName(self):
return "gdalogr:polygonize"

@@ -52,7 +52,7 @@ class proximity(GeoAlgorithm):
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/proximity.png'
return QtGui.QIcon(filepath)

def commandLineName(self):
return "gdalogr:proximity"

@@ -50,7 +50,7 @@ class rasterize(GeoAlgorithm):
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/rasterize.png'
return QtGui.QIcon(filepath)

def commandLineName(self):
return "gdalogr:rasterize"

@@ -57,7 +57,7 @@ class translate(GeoAlgorithm):
def getIcon(self):
filepath = os.path.dirname(__file__) + '/icons/translate.png'
return QtGui.QIcon(filepath)

def commandLineName(self):
return "gdalogr:translate"

@@ -382,7 +382,7 @@ def processAlgorithm(self, progress):
else:
command = 'r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW"'
command += ' input='

if self.grassName == 'r.horizon':
command += out.name + uniqueSufix + '_0'
else:
@@ -126,9 +126,9 @@ def __init__(self, alg, mainWidget):
self.buttonBox.rejected.connect(self.close)
self.buttonBox.button(
QtGui.QDialogButtonBox.Cancel).clicked.connect(self.cancel)

self.showDebug = ProcessingConfig.getSetting(
ProcessingConfig.SHOW_DEBUG_IN_DIALOG)
ProcessingConfig.SHOW_DEBUG_IN_DIALOG)

def setParamValues(self):
params = self.alg.parameters
@@ -139,7 +139,7 @@ def updateHtmlView(self):

def getDescription(self, name):
if name in self.descriptions:
return self.descriptions[name].replace('\n', '<br>')
return self.descriptions[name].replace('\n', '<br>')
else:
return ''

@@ -45,10 +45,10 @@ def __init__(self):

def error(self, msg):
interface.iface.messageBar().clearWidgets()
interface.iface.messageBar().pushMessage("Error", msg,
interface.iface.messageBar().pushMessage("Error", msg,
level = QgsMessageBar.CRITICAL,
duration = 3)

def setText(self, text):
pass

0 comments on commit ec0f0be

Please sign in to comment.
You can’t perform that action at this time.