Skip to content
Permalink
Browse files
indentation update
  • Loading branch information
jef-n committed Feb 7, 2013
1 parent 76d1403 commit cb7f7bfd8b1f6e174b142b14a3d0234b15870980
Showing with 777 additions and 768 deletions.
  1. +1 −1 python/console/console.py
  2. +1 −1 python/console/console_sci.py
  3. +2 −2 python/plugins/sextante/algs/AddTableField.py
  4. +1 −1 python/plugins/sextante/algs/AutoincrementalField.py
  5. +1 −1 python/plugins/sextante/algs/CreateConstantRaster.py
  6. +4 −4 python/plugins/sextante/algs/EquivalentNumField.py
  7. +1 −1 python/plugins/sextante/algs/Explode.py
  8. +2 −2 python/plugins/sextante/algs/FieldPyculator.py
  9. +1 −1 python/plugins/sextante/algs/FieldsCalculator.py
  10. +3 −3 python/plugins/sextante/algs/JoinAttributes.py
  11. +6 −6 python/plugins/sextante/algs/PointsLayerFromTable.py
  12. +2 −2 python/plugins/sextante/algs/QGISAlgorithmProvider.py
  13. +3 −3 python/plugins/sextante/algs/ftools/Clip.py
  14. +2 −2 python/plugins/sextante/algs/ftools/Delaunay.py
  15. +1 −1 python/plugins/sextante/algs/ftools/DensifyGeometriesInterval.py
  16. +6 −6 python/plugins/sextante/algs/ftools/Difference.py
  17. +2 −2 python/plugins/sextante/algs/ftools/Dissolve.py
  18. +4 −4 python/plugins/sextante/algs/ftools/ExportGeometryInfo.py
  19. +6 −6 python/plugins/sextante/algs/ftools/ExtentFromLayer.py
  20. +6 −6 python/plugins/sextante/algs/ftools/FToolsUtils.py
  21. +7 −7 python/plugins/sextante/algs/ftools/Intersection.py
  22. +4 −4 python/plugins/sextante/algs/ftools/MeanCoords.py
  23. +1 −1 python/plugins/sextante/algs/ftools/MultipartToSingleparts.py
  24. +1 −1 python/plugins/sextante/algs/ftools/NearestNeighbourAnalysis.py
  25. +6 −6 python/plugins/sextante/algs/ftools/PointDistance.py
  26. +1 −1 python/plugins/sextante/algs/ftools/PointsInPolygon.py
  27. +1 −1 python/plugins/sextante/algs/ftools/PointsInPolygonUnique.py
  28. +1 −1 python/plugins/sextante/algs/ftools/PointsInPolygonWeighted.py
  29. +6 −6 python/plugins/sextante/algs/ftools/SelectByLocation.py
  30. +2 −2 python/plugins/sextante/algs/ftools/SumLines.py
  31. +13 −13 python/plugins/sextante/algs/ftools/Union.py
  32. +1 −1 python/plugins/sextante/algs/ftools/UniqueValues.py
  33. +167 −167 python/plugins/sextante/algs/mmqgisx/MMQGISXAlgorithms.py
  34. +1 −1 python/plugins/sextante/core/AlgorithmProvider.py
  35. +6 −6 python/plugins/sextante/core/GeoAlgorithm.py
  36. +1 −1 python/plugins/sextante/core/LayerExporter.py
  37. +8 −8 python/plugins/sextante/core/QGisLayers.py
  38. +8 −8 python/plugins/sextante/core/Sextante.py
  39. +2 −2 python/plugins/sextante/core/SextanteConfig.py
  40. +10 −10 python/plugins/sextante/core/SextanteRasterWriter.py
  41. +2 −2 python/plugins/sextante/core/SextanteVectorWriter.py
  42. +2 −2 python/plugins/sextante/grass/GrassAlgorithm.py
  43. +3 −3 python/plugins/sextante/gui/AlgorithmExecutionDialog.py
  44. +1 −1 python/plugins/sextante/gui/ParametersPanel.py
  45. +1 −1 python/plugins/sextante/modeler/EditModelAction.py
  46. +14 −14 python/plugins/sextante/modeler/ModelerAlgorithm.py
  47. +1 −1 python/plugins/sextante/modeler/ModelerAlgorithmProvider.py
  48. +22 −22 python/plugins/sextante/modeler/ModelerParametersDialog.py
  49. +10 −11 python/plugins/sextante/modeler/MultilineTextPanel.py
  50. +5 −5 python/plugins/sextante/outputs/OutputRaster.py
  51. +4 −4 python/plugins/sextante/outputs/OutputTable.py
  52. +7 −7 python/plugins/sextante/outputs/OutputVector.py
  53. +3 −3 python/plugins/sextante/parameters/ParameterTable.py
  54. +1 −1 python/plugins/sextante/saga/SagaAlgorithmProvider.py
  55. +3 −3 python/plugins/sextante/ui/ui_DlgConfig.py
  56. +3 −3 python/plugins/sextante/ui/ui_DlgModeler.py
  57. +2 −2 python/plugins/sextante/ui/ui_SextanteToolbox.py
  58. +8 −4 scripts/astyle-all.sh
  59. +1 −1 scripts/prepare-commit.sh
  60. +1 −1 src/app/composer/qgscomposeritemwidget.cpp
  61. +2 −2 src/app/composer/qgscomposerlabelwidget.cpp
  62. +1 −1 src/app/main.cpp
  63. +1 −1 src/app/qgslabeldialog.cpp
  64. +4 −4 src/core/composer/qgscomposerlabel.cpp
  65. +1 −1 src/core/composer/qgscomposermap.cpp
  66. +1 −1 src/core/composer/qgsscalebarstyle.cpp
  67. +1 −1 src/core/qgsbrowsermodel.cpp
  68. +49 −48 src/core/qgsfield.h
  69. +2 −1 src/core/qgsofflineediting.h
  70. +1 −1 src/core/qgsproject.h
  71. +1 −1 src/core/qgsvectordataprovider.cpp
  72. +56 −56 src/core/qgsvectorlayerundocommand.h
  73. +1 −1 src/core/symbology-ng/qgsstylev2.cpp
  74. +2 −2 src/gui/attributetable/qgsattributetablemodel.cpp
  75. +3 −3 src/gui/qgsrubberband.cpp
  76. +1 −1 src/gui/qgsrubberband.h
  77. +11 −8 src/providers/gpx/qgsgpxprovider.cpp
  78. +4 −3 src/providers/gpx/qgsgpxprovider.h
  79. +1 −1 src/providers/grass/qgsgrassprovider.cpp
  80. +26 −26 src/providers/mssql/qgsmssqlfeatureiterator.cpp
  81. +2 −2 src/providers/mssql/qgsmssqlfeatureiterator.h
  82. +22 −22 src/providers/mssql/qgsmssqlprovider.cpp
  83. +46 −46 src/providers/oracle/qgsoraclefeatureiterator.cpp
  84. +2 −2 tests/src/core/testqgsexpression.cpp
  85. +140 −140 tests/src/python/test_qgsvectorlayer.py
@@ -352,7 +352,7 @@ def openSettings(self):
def prefChanged(self):
self.edit.refreshLexerProperties()
self.textEditOut.refreshLexerProperties()

def callWidgetMessageBar(self, text):
self.textEditOut.widgetMessageBar(iface, text)

@@ -41,7 +41,7 @@ def __init__(self, parent=None):
code.InteractiveInterpreter.__init__(self, locals=None)

self.parent = parent

# Enable non-ascii chars for editor
self.setUtf8(True)

@@ -67,7 +67,7 @@ def processAlgorithm(self, progress):
fields[len(fields)] = QgsField(fieldname, self.TYPES[fieldtype])
writer = output.getVectorWriter(fields, vprovider.geometryType(), vprovider.crs() )
outFeat = QgsFeature()
inGeom = QgsGeometry()
inGeom = QgsGeometry()
nElement = 0
features = QGisLayers.features(vlayer)
nFeat = len(features)
@@ -77,7 +77,7 @@ def processAlgorithm(self, progress):
inGeom = inFeat.geometry()
outFeat.setGeometry( inGeom )
atMap = inFeat.attributeMap()
atMap.append(QVariant())
atMap.append(QVariant())
outFeat.addAttribute( len(vprovider.fields()), QVariant() )
writer.addFeature( outFeat )
del writer
@@ -60,7 +60,7 @@ def processAlgorithm(self, progress):
outFeat.setGeometry( inGeom )
atMap = inFeat.attributeMap()
atMap.append(QVariant(nElement))
outFeat.setAttributeMap( atMap )
outFeat.setAttributeMap( atMap )
writer.addFeature( outFeat )
del writer

@@ -51,7 +51,7 @@ def processAlgorithm(self, progress):
value = self.getOutputValue(self.NUMBER)
layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
cellsize = (layer.extent().xMaximum() - layer.extent().xMinimum())/layer.width()
w = SextanteRasterWriter(output.getCompatibleFileName(self), layer.extent().xMinimum(), layer.extent().yMinimum(), layer.extent().xMaximum(),
w = SextanteRasterWriter(output.getCompatibleFileName(self), layer.extent().xMinimum(), layer.extent().yMinimum(), layer.extent().xMaximum(),
layer.extent().yMaximum(), cellsize, 1, self.crs)
w.matrix[:] = value
w.close()
@@ -47,12 +47,12 @@ def processAlgorithm(self, progress):
output = self.getOutputFromName(self.OUTPUT)
vlayer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
vprovider = vlayer.dataProvider()
fieldindex = vlayer.fieldNameIndex(fieldname)
fieldindex = vlayer.fieldNameIndex(fieldname)
fields = vprovider.fields()
fields.append(QgsField("NUM_FIELD", QVariant.Int))
writer = output.getVectorWriter(fields, vprovider.geometryType(), vprovider.crs() )
writer = output.getVectorWriter(fields, vprovider.geometryType(), vprovider.crs() )
outFeat = QgsFeature()
inGeom = QgsGeometry()
inGeom = QgsGeometry()
nElement = 0
classes = {}
features = QGisLayers.features(vlayer)
@@ -67,7 +67,7 @@ def processAlgorithm(self, progress):
if clazz not in classes:
classes[clazz] = len(classes.keys())
atMap.append(QVariant(classes[clazz]))
outFeat.setAttributes(atMap)
outFeat.setAttributes(atMap)
writer.addFeature( outFeat )
del writer

@@ -48,7 +48,7 @@ def processAlgorithm(self, progress):
fields = vprovider.fields()
writer = output.getVectorWriter(fields, QGis.WKBLineString, vprovider.crs() )
outFeat = QgsFeature()
inGeom = QgsGeometry()
inGeom = QgsGeometry()
nElement = 0
features = QGisLayers.features(layer)
nFeat = len(features)
@@ -126,7 +126,7 @@ def processAlgorithm(self, progress):
new_ns['__geom'] = geom

if need_attrs:
pyattrs = [self.Qvar2py(a) for a in attrMap]
pyattrs = [self.Qvar2py(a) for a in attrMap]
new_ns['__attr'] = pyattrs

#clear old result
@@ -158,7 +158,7 @@ def processAlgorithm(self, progress):
nElement += 1
outFeat.setGeometry( feat.geometry() )
attrMap.append(QVariant(new_ns[self.RESULT_VAR_NAME]))
outFeat.setAttributeMap( attrMap )
outFeat.setAttributeMap( attrMap )
writer.addFeature(outFeat)

del writer
@@ -86,7 +86,7 @@ def processAlgorithm(self, progress):
outFeat.setGeometry(inGeom)
atMap = inFeat.attributeMap()
atMap.append(QVariant(result))
outFeat.setAttributeMap(atMap)
outFeat.setAttributeMap(atMap)
writer.addFeature(outFeat)
del writer

@@ -83,16 +83,16 @@ def processAlgorithm(self, progress):
for inFeat in features:
inGeom = inFeat.geometry()
atMap = inFeat.attributes()
join_value1 = atMap[join_field1_index].toString()
join_value1 = atMap[join_field1_index].toString()
while provider2.nextFeature(inFeat2):
## Maybe it should cache this entries...
atMap2 = inFeat2.attributeMap()
join_value2 = atMap2[join_field2_index].toString()
if join_value1 == join_value2:
# create the new feature
outFeat.setGeometry(inGeom)
outFeat.setGeometry(inGeom)
atMap.extend(atMap2)
break;
break;
outFeat.setAttributes(atMap)
writer.addFeature(outFeat)

@@ -53,15 +53,15 @@ def processAlgorithm(self, progress):
fields = vprovider.fields()
writer = output.getVectorWriter(fields, QGis.WKBPoint, self.crs)
xfieldindex = vlayer.fieldNameIndex(self.getParameterValue(self.XFIELD))
yfieldindex = vlayer.fieldNameIndex(self.getParameterValue(self.YFIELD))
outFeat = QgsFeature()
yfieldindex = vlayer.fieldNameIndex(self.getParameterValue(self.YFIELD))

outFeat = QgsFeature()
nElement = 0
features = QGisLayers.features(vlayer)
nFeat = len(features)
for feature in features:
nElement += 1
progress.setPercentage((nElement*100)/nFeat)
progress.setPercentage((nElement*100)/nFeat)
attrs = feature.attributes()
try:
x = float(attrs[xfieldindex].toString())
@@ -70,9 +70,9 @@ def processAlgorithm(self, progress):
continue
pt = QgsPoint(x, y)
outFeat.setGeometry(QgsGeometry.fromPoint(pt))
outFeat.setAttributes(attrs)
outFeat.setAttributes(attrs)
writer.addFeature(outFeat)

del writer


@@ -63,7 +63,7 @@
mmqgisx_geometry_convert_algorithm,
mmqgisx_grid_algorithm, mmqgisx_gridify_algorithm,
mmqgisx_hub_distance_algorithm, mmqgisx_hub_lines_algorithm,
mmqgisx_merge_algorithm, mmqgisx_select_algorithm,
mmqgisx_merge_algorithm, mmqgisx_select_algorithm,
mmqgisx_text_to_float_algorithm)
from sextante.algs.EquivalentNumField import EquivalentNumField
from sextante.core.AlgorithmProvider import AlgorithmProvider
@@ -116,7 +116,7 @@ def __init__(self):
mmqgisx_hub_distance_algorithm(),
mmqgisx_hub_lines_algorithm(),
mmqgisx_merge_algorithm(),
mmqgisx_select_algorithm(),
mmqgisx_select_algorithm(),
mmqgisx_text_to_float_algorithm(),
#raster
CreateConstantRaster()]
@@ -58,7 +58,7 @@ def processAlgorithm(self, progress):
vproviderB = vlayerB.dataProvider()
#allAttrsB = vproviderB.attributeIndexes()
#vproviderB.select( allAttrsB )

# check for crs compatibility
crsA = vproviderA.crs()
crsB = vproviderB.crs()
@@ -75,9 +75,9 @@ def processAlgorithm(self, progress):
outFeat = QgsFeature()
index = utils.createSpatialIndex(vlayerB)
#vproviderA.rewind()
nElement = 0
nElement = 0
selectionA = QGisLayers.features(vlayerA)
nFeat = len(selectionA)
nFeat = len(selectionA)
for inFeatA in selectionA:
nElement += 1
progress.setPercentage(nElement/float(nFeat) * 100)
@@ -55,7 +55,7 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))


fields = [ QgsField("POINTA", QVariant.Double, "", 24, 15),
QgsField("POINTB", QVariant.Double, "", 24, 15),
@@ -105,7 +105,7 @@ def processAlgorithm(self, progress):
point = QgsPoint(geom.asPoint())
polygon.append(point)
if step <= 3:
attrs.append(QVariant(ids[index]))
attrs.append(QVariant(ids[index]))
step += 1
feat.setAttributes(attrs)
geometry = QgsGeometry().fromPolygon([polygon])
@@ -56,7 +56,7 @@ def processAlgorithm(self, progress):
layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
interval = self.getParameterValue(self.INTERVAL)

isPolygon = layer.geometryType() == QGis.Polygon
isPolygon = layer.geometryType() == QGis.Polygon

writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(layer.pendingFields(),
layer.wkbType(), layer.crs())
@@ -47,11 +47,11 @@ class Difference(GeoAlgorithm):

def processAlgorithm(self, progress):
vlayerA = QGisLayers.getObjectFromUri(self.getParameterValue(Difference.INPUT))
vlayerB = QGisLayers.getObjectFromUri(self.getParameterValue(Difference.INPUT2))
vlayerB = QGisLayers.getObjectFromUri(self.getParameterValue(Difference.INPUT2))
GEOS_EXCEPT = True
FEATURE_EXCEPT = True
vproviderA = vlayerA.dataProvider()
vproviderB = vlayerB.dataProvider()
vproviderB = vlayerB.dataProvider()
fields = vproviderA.fields()
# check for crs compatibility
crsA = vproviderA.crs()
@@ -67,8 +67,8 @@ def processAlgorithm(self, progress):
outFeat = QgsFeature()
index = utils.createSpatialIndex(vlayerB)
nElement = 0
selectionA = QGisLayers.features(vlayerA)
nFeat = len(selectionA)
selectionA = QGisLayers.features(vlayerA)
nFeat = len(selectionA)
for inFeatA in selectionA:
nElement += 1
progress.setPercentage(nElement/float(nFeat) * 100)
@@ -77,7 +77,7 @@ def processAlgorithm(self, progress):
diff_geom = QgsGeometry( geom )
atMap = inFeatA.attributes()
intersects = index.intersects( geom.boundingBox() )
for id in intersects:
for id in intersects:
vlayerB.featureAtId( int( id ), inFeatB , True, allAttrsB )
tmpGeom = QgsGeometry( inFeatB.geometry() )
try:
@@ -96,7 +96,7 @@ def processAlgorithm(self, progress):
FEATURE_EXCEPT = False
continue


del writer
if not GEOS_EXCEPT:
SextanteLog.addToLog(SextanteLog.LOG_WARNING, "Geometry exception while computing difference")
@@ -53,11 +53,11 @@ def processAlgorithm(self, progress):
vlayerA = QGisLayers.getObjectFromUri(self.getParameterValue(Dissolve.INPUT))
field = vlayerA.fieldNameIndex(fieldname)
GEOS_EXCEPT = True
vproviderA = vlayerA.dataProvider()
vproviderA = vlayerA.dataProvider()
fields = vproviderA.fields()
writer = self.getOutputFromName(Dissolve.OUTPUT).getVectorWriter(fields, vproviderA.geometryType(), vproviderA.crs() )
#inFeat = QgsFeature()
outFeat = QgsFeature()
outFeat = QgsFeature()
nElement = 0
nFeat = vproviderA.featureCount()
if not useField:
@@ -70,9 +70,9 @@ def processAlgorithm(self, progress):

if geometryType == QGis.Polygon:
fields.append(QgsField(QString("area"), QVariant.Double))
fields.append(QgsField(QString("perimeter"), QVariant.Double))
fields.append(QgsField(QString("perimeter"), QVariant.Double))
elif geometryType == QGis.Line:
fields.append(QgsField(QString("length"), QVariant.Double))
fields.append(QgsField(QString("length"), QVariant.Double))
else:
fields.append(QgsField(QString("xcoords"), QVariant.Double))
fields.append(QgsField(QString("ycoords"), QVariant.Double))
@@ -113,10 +113,10 @@ def processAlgorithm(self, progress):

outFeat.setGeometry(inGeom)
atMap = inFeat.attributes()
atMap.append(QVariant(attr1))
atMap.append(QVariant(attr1))
if attr2 is not None:
atMap.append(QVariant(attr2))
outFeat.setAttributes(atMap)
outFeat.setAttributes(atMap)
writer.addFeature(outFeat)

current += 1
@@ -76,10 +76,10 @@ def processAlgorithm(self, progress):
self.featureExtent(layer, writer, progress)
else:
self.layerExtent(layer, writer, progress)

del writer

def layerExtent(self, layer, writer, progress):
del writer

def layerExtent(self, layer, writer, progress):
rect = layer.extent()
minx = rect.xMinimum()
miny = rect.yMinimum()
@@ -97,10 +97,10 @@ def layerExtent(self, layer, writer, progress):
QgsPoint(maxx, maxy),
QgsPoint(maxx, miny),
QgsPoint(minx, miny)
]
]
geometry = QgsGeometry().fromPolygon([rect])
feat = QgsFeature()
feat.setGeometry(geometry)
feat.setGeometry(geometry)
attrs = [QVariant(minx),
QVariant(miny),
QVariant(maxx),
@@ -153,7 +153,7 @@ def featureExtent(self, layer, writer, progress):
QVariant(height),
QVariant(width) ]
feat.setAttributes(attrs)

writer.addFeature(feat)
current += 1
progress.setPercentage(int(current * total))
@@ -27,7 +27,7 @@
from qgis.core import *

def createSpatialIndex(layer):
idx = QgsSpatialIndex()
idx = QgsSpatialIndex()
features = QGisLayers.features(layer)
for ft in features:
idx.insertFeature(ft)
@@ -61,12 +61,12 @@ def createUniqueFieldName(fieldName, fieldList):

def findOrCreateField(layer, fieldList, fieldName, fieldLen=24, fieldPrec=15):
idx = layer.fieldNameIndex(fieldName)
if idx == -1:
if idx == -1:
fn = createUniqueFieldName(fieldName, fieldList)
field = QgsField(fn, QVariant.Double, "", fieldLen, fieldPrec)
idx = len(fieldList)
fieldList.append(field)

return idx, fieldList

def extractPoints( geom ):
@@ -96,13 +96,13 @@ def extractPoints( geom ):

return points

def getUniqueValues(layer, fieldIndex):
def getUniqueValues(layer, fieldIndex):
values = []
layer.select([fieldIndex], QgsRectangle(), False)
features = QGisLayers.features(layer)
for feat in features:
if feat.attributes()[fieldIndex] not in values:
values.append(feat.attributes()[fieldIndex])
values.append(feat.attributes()[fieldIndex])
return values

def getUniqueValuesCount(layer, fieldIndex):
@@ -114,7 +114,7 @@ def combineVectorFields( layerA, layerB ):
fieldsB = layerB.dataProvider().fields()
fieldsB = testForUniqueness( fieldsA, fieldsB )
for field in fieldsB:
fieldsA.append(field)
fieldsA.append(field)
return fieldsA

# Check if two input field maps are unique, and resolve name issues if they aren't
Loading

0 comments on commit cb7f7bf

Please sign in to comment.