Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Dec 14, 2016
1 parent 595ef7f commit 8d8bbab
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 75 deletions.
20 changes: 10 additions & 10 deletions python/plugins/processing/algs/qgis/ServiceAreaFromLayer.py
Expand Up @@ -37,7 +37,7 @@
QgsNetworkSpeedStrategy,
QgsGraphBuilder,
QgsGraphAnalyzer
)
)
from qgis.utils import iface

from processing.core.GeoAlgorithm import GeoAlgorithm
Expand All @@ -47,10 +47,10 @@
ParameterString,
ParameterTableField,
ParameterSelection
)
)
from processing.core.outputs import (OutputNumber,
OutputVector
)
)
from processing.tools import dataobjects, vector

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
Expand Down Expand Up @@ -78,13 +78,13 @@ def getIcon(self):

def defineCharacteristics(self):
self.DIRECTIONS = OrderedDict([
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])

self.STRATEGIES = [self.tr('Shortest'),
self.tr('Fastest')
]
]

self.name, self.i18n_name = self.trAlgorithm('Service area (from layer)')
self.group, self.i18n_group = self.trAlgorithm('Network analysis')
Expand Down Expand Up @@ -148,9 +148,9 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT_VECTOR))
self.getParameterValue(self.INPUT_VECTOR))
startPoints = dataobjects.getObjectFromUri(
self.getParameterValue(self.START_POINTS))
self.getParameterValue(self.START_POINTS))
strategy = self.getParameterValue(self.STRATEGY)
travelCost = self.getParameterValue(self.TRAVEL_COST)

Expand Down Expand Up @@ -237,7 +237,7 @@ def processAlgorithm(self, progress):
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
for j, v in enumerate(cost):
if v > travelCost and tree[j] != -1:
vertexId = graph.edge(tree [j]).outVertex()
vertexId = graph.edge(tree[j]).outVertex()
if cost[vertexId] <= travelCost:
vertices.append(j)

Expand Down
20 changes: 10 additions & 10 deletions python/plugins/processing/algs/qgis/ServiceAreaFromPoint.py
Expand Up @@ -37,7 +37,7 @@
QgsNetworkSpeedStrategy,
QgsGraphBuilder,
QgsGraphAnalyzer
)
)
from qgis.utils import iface

from processing.core.GeoAlgorithm import GeoAlgorithm
Expand All @@ -48,10 +48,10 @@
ParameterString,
ParameterTableField,
ParameterSelection
)
)
from processing.core.outputs import (OutputNumber,
OutputVector
)
)
from processing.tools import dataobjects

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
Expand Down Expand Up @@ -79,13 +79,13 @@ def getIcon(self):

def defineCharacteristics(self):
self.DIRECTIONS = OrderedDict([
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])

self.STRATEGIES = [self.tr('Shortest'),
self.tr('Fastest')
]
]

self.name, self.i18n_name = self.trAlgorithm('Service area (from point)')
self.group, self.i18n_group = self.trAlgorithm('Network analysis')
Expand All @@ -94,7 +94,7 @@ def defineCharacteristics(self):
self.tr('Vector layer representing network'),
[dataobjects.TYPE_VECTOR_LINE]))
self.addParameter(ParameterPoint(self.START_POINT,
self.tr('Start point')))
self.tr('Start point')))
self.addParameter(ParameterSelection(self.STRATEGY,
self.tr('Path type to calculate'),
self.STRATEGIES,
Expand Down Expand Up @@ -148,7 +148,7 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT_VECTOR))
self.getParameterValue(self.INPUT_VECTOR))
startPoint = self.getParameterValue(self.START_POINT)
strategy = self.getParameterValue(self.STRATEGY)
travelCost = self.getParameterValue(self.TRAVEL_COST)
Expand Down Expand Up @@ -205,7 +205,7 @@ def processAlgorithm(self, progress):
vertices = []
for i, v in enumerate(cost):
if v > travelCost and tree[i] != -1:
vertexId = graph.edge(tree [i]).outVertex()
vertexId = graph.edge(tree[i]).outVertex()
if cost[vertexId] <= travelCost:
vertices.append(i)

Expand Down
20 changes: 10 additions & 10 deletions python/plugins/processing/algs/qgis/ShortestPathLayerToPoint.py
Expand Up @@ -37,7 +37,7 @@
QgsNetworkSpeedStrategy,
QgsGraphBuilder,
QgsGraphAnalyzer
)
)
from qgis.utils import iface

from processing.core.GeoAlgorithm import GeoAlgorithm
Expand All @@ -49,7 +49,7 @@
ParameterString,
ParameterTableField,
ParameterSelection
)
)
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector

Expand Down Expand Up @@ -77,13 +77,13 @@ def getIcon(self):

def defineCharacteristics(self):
self.DIRECTIONS = OrderedDict([
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])

self.STRATEGIES = [self.tr('Shortest'),
self.tr('Fastest')
]
]

self.name, self.i18n_name = self.trAlgorithm('Shortest path (layer to point)')
self.group, self.i18n_group = self.trAlgorithm('Network analysis')
Expand All @@ -95,7 +95,7 @@ def defineCharacteristics(self):
self.tr('Vector layer with start points'),
[dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterPoint(self.END_POINT,
self.tr('End point')))
self.tr('End point')))
self.addParameter(ParameterSelection(self.STRATEGY,
self.tr('Path type to calculate'),
self.STRATEGIES,
Expand Down Expand Up @@ -143,9 +143,9 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT_VECTOR))
self.getParameterValue(self.INPUT_VECTOR))
startPoints = dataobjects.getObjectFromUri(
self.getParameterValue(self.START_POINTS))
self.getParameterValue(self.START_POINTS))
endPoint = self.getParameterValue(self.END_POINT)
strategy = self.getParameterValue(self.STRATEGY)

Expand Down Expand Up @@ -226,7 +226,7 @@ def processAlgorithm(self, progress):
route = []

total = 100.0 / count
for i in range(1, count +1):
for i in range(1, count + 1):
idxStart = graph.findVertex(snappedPoints[i])
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)

Expand Down
20 changes: 10 additions & 10 deletions python/plugins/processing/algs/qgis/ShortestPathPointToLayer.py
Expand Up @@ -37,7 +37,7 @@
QgsNetworkSpeedStrategy,
QgsGraphBuilder,
QgsGraphAnalyzer
)
)
from qgis.utils import iface

from processing.core.GeoAlgorithm import GeoAlgorithm
Expand All @@ -49,7 +49,7 @@
ParameterString,
ParameterTableField,
ParameterSelection
)
)
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector

Expand Down Expand Up @@ -77,13 +77,13 @@ def getIcon(self):

def defineCharacteristics(self):
self.DIRECTIONS = OrderedDict([
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])

self.STRATEGIES = [self.tr('Shortest'),
self.tr('Fastest')
]
]

self.name, self.i18n_name = self.trAlgorithm('Shortest path (point to layer)')
self.group, self.i18n_group = self.trAlgorithm('Network analysis')
Expand All @@ -92,7 +92,7 @@ def defineCharacteristics(self):
self.tr('Vector layer representing network'),
[dataobjects.TYPE_VECTOR_LINE]))
self.addParameter(ParameterPoint(self.START_POINT,
self.tr('Start point')))
self.tr('Start point')))
self.addParameter(ParameterVector(self.END_POINTS,
self.tr('Vector layer with end points'),
[dataobjects.TYPE_VECTOR_POINT]))
Expand Down Expand Up @@ -143,10 +143,10 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT_VECTOR))
self.getParameterValue(self.INPUT_VECTOR))
startPoint = self.getParameterValue(self.START_POINT)
endPoints = dataobjects.getObjectFromUri(
self.getParameterValue(self.END_POINTS))
self.getParameterValue(self.END_POINTS))
strategy = self.getParameterValue(self.STRATEGY)

directionFieldName = self.getParameterValue(self.DIRECTION_FIELD)
Expand Down Expand Up @@ -227,7 +227,7 @@ def processAlgorithm(self, progress):
route = []

total = 100.0 / count
for i in range(1, count +1):
for i in range(1, count + 1):
idxEnd = graph.findVertex(snappedPoints[i])

if tree[idxEnd] == -1:
Expand Down
20 changes: 10 additions & 10 deletions python/plugins/processing/algs/qgis/ShortestPathPointToPoint.py
Expand Up @@ -37,7 +37,7 @@
QgsNetworkSpeedStrategy,
QgsGraphBuilder,
QgsGraphAnalyzer
)
)
from qgis.utils import iface

from processing.core.GeoAlgorithm import GeoAlgorithm
Expand All @@ -48,10 +48,10 @@
ParameterString,
ParameterTableField,
ParameterSelection
)
)
from processing.core.outputs import (OutputNumber,
OutputVector
)
)
from processing.tools import dataobjects

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
Expand Down Expand Up @@ -79,13 +79,13 @@ def getIcon(self):

def defineCharacteristics(self):
self.DIRECTIONS = OrderedDict([
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])

self.STRATEGIES = [self.tr('Shortest'),
self.tr('Fastest')
]
]

self.name, self.i18n_name = self.trAlgorithm('Shortest path (point to point)')
self.group, self.i18n_group = self.trAlgorithm('Network analysis')
Expand All @@ -94,9 +94,9 @@ def defineCharacteristics(self):
self.tr('Vector layer representing network'),
[dataobjects.TYPE_VECTOR_LINE]))
self.addParameter(ParameterPoint(self.START_POINT,
self.tr('Start point')))
self.tr('Start point')))
self.addParameter(ParameterPoint(self.END_POINT,
self.tr('End point')))
self.tr('End point')))
self.addParameter(ParameterSelection(self.STRATEGY,
self.tr('Path type to calculate'),
self.STRATEGIES,
Expand Down Expand Up @@ -146,7 +146,7 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT_VECTOR))
self.getParameterValue(self.INPUT_VECTOR))
startPoint = self.getParameterValue(self.START_POINT)
endPoint = self.getParameterValue(self.END_POINT)
strategy = self.getParameterValue(self.STRATEGY)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/SpatialJoin.py
Expand Up @@ -180,7 +180,7 @@ def processAlgorithm(self, progress):

res = False
for predicate in predicates:
res= getattr(inGeom, predicate)(inGeomB)
res = getattr(inGeom, predicate)(inGeomB)
if res:
break

Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/SplitWithLines.py
Expand Up @@ -61,7 +61,7 @@ def processAlgorithm(self, progress):
fieldList = layerA.fields()

writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(fieldList,
QgsWkbTypes.multiType(layerA.wkbType()), layerA.crs())
QgsWkbTypes.multiType(layerA.wkbType()), layerA.crs())

spatialIndex = QgsSpatialIndex()
splitGeoms = {}
Expand Down Expand Up @@ -166,7 +166,7 @@ def processAlgorithm(self, progress):
for aGeom in inGeoms:
passed = True

if QgsWkbTypes.geometryType( aGeom.wkbType() ) == QgsWkbTypes.LineGeometry:
if QgsWkbTypes.geometryType(aGeom.wkbType()) == QgsWkbTypes.LineGeometry:
numPoints = aGeom.geometry().numPoints()

if numPoints <= 2:
Expand Down

1 comment on commit 8d8bbab

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jef-n I think what's happening here is that autopep8 is missing from the qt5 travis environment. That's how these have slipped through.

Please sign in to comment.