Skip to content

Commit 4184934

Browse files
arnaud-morvanvolaya
authored andcommitted
[processing] Apply 2to3 on changes
1 parent effcb5e commit 4184934

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+106
-107
lines changed

python/plugins/processing/algs/gdal/GdalUtils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def getVectorDriverFromFileName(filename):
155155
return 'ESRI Shapefile'
156156

157157
formats = QgsVectorFileWriter.supportedFiltersAndFormats()
158-
for k, v in formats.items():
158+
for k, v in list(formats.items()):
159159
if ext in k:
160160
return v
161161
return 'ESRI Shapefile'

python/plugins/processing/algs/gdal/gdal2tiles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def getConsoleCommands(self):
168168

169169
parameters = {self.TITLE: '-t', self.COPYRIGHT: '-c',
170170
self.GOOGLEKEY: '-g', self.BINGKEY: '-b'}
171-
for arg, parameter in parameters.items():
171+
for arg, parameter in list(parameters.items()):
172172
if self.getParameterValue(arg):
173173
arguments.append(parameter)
174174
arguments.append(self.getParameterValue(arg))

python/plugins/processing/algs/grass7/ext/i.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def exportInputRasters(alg, rasterDic):
174174
{ 'inputName1': 'outputName1', 'inputName2': 'outputName2'}
175175
"""
176176
# Get inputs and outputs
177-
for inputName, outputName in rasterDic.items():
177+
for inputName, outputName in list(rasterDic.items()):
178178
inputRaster = alg.getParameterValue(inputName)
179179
outputRaster = alg.getOutputFromName(outputName)
180180
command = 'r.out.gdal -c -t -f --overwrite createopt="TFW=YES,COMPRESS=LZW" input={} output=\"{}\"'.format(

python/plugins/processing/algs/grass7/ext/v_net.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def variableOutput(alg, params, nocats=True):
8787
"""
8888

8989
# Build the v.out.ogr commands
90-
for outputName, typeList in params.items():
90+
for outputName, typeList in list(params.items()):
9191
if not isinstance(typeList, list):
9292
continue
9393

python/plugins/processing/algs/help/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def replace(s):
5050
return s.replace("{qgisdocs}", "https://docs.qgis.org/%s/%s/docs" % (version, locale))
5151
else:
5252
return None
53-
h = {k: replace(v) for k, v in h.items()}
53+
h = {k: replace(v) for k, v in list(h.items())}
5454
return h
5555

5656

python/plugins/processing/algs/lidar/lastools/lasquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def processAlgorithm(self, progress):
6161
layers = QgsMapLayerRegistry.instance().mapLayers()
6262

6363
# loop over layers
64-
for name, layer in layers.items():
64+
for name, layer in list(layers.items()):
6565
layerType = layer.type()
6666
if layerType == QgsMapLayer.VectorLayer:
6767
shp_file_name = layer.source()

python/plugins/processing/algs/otb/OTBAlgorithm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* *
2323
***************************************************************************
2424
"""
25+
from builtins import next
2526
from future import standard_library
2627
standard_library.install_aliases()
2728
from builtins import map
@@ -307,7 +308,7 @@ def processAlgorithm(self, progress):
307308
OTBUtils.executeOtb(helperCommands, progress)
308309

309310
if self.roiRasters:
310-
supportRaster = next(iter(self.roiRasters.values()))
311+
supportRaster = next(iter(list(self.roiRasters.values())))
311312
for roiInput, roiFile in list(self.roiVectors.items()):
312313
helperCommands = [
313314
"otbcli_VectorDataExtractROIApplication",

python/plugins/processing/algs/otb/maintenance/parsing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* *
1818
***************************************************************************
1919
"""
20+
from builtins import next
2021
from builtins import str
2122
from builtins import range
2223
__author__ = 'Julien Malik, Oscar Picas'

python/plugins/processing/algs/qgis/ConcaveHull.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def processAlgorithm(self, progress):
8989
counter = 50. / len(edges)
9090
i = 0
9191
ids = []
92-
for id, max_len in edges.items():
92+
for id, max_len in list(edges.items()):
9393
if max_len > alpha * max_length:
9494
ids.append(id)
9595
progress.setPercentage(50 + i * counter)

python/plugins/processing/algs/qgis/Delaunay.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Victor Olaya'
2122
__date__ = 'August 2012'

python/plugins/processing/algs/qgis/DeleteDuplicateGeometries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def processAlgorithm(self, progress):
6464

6565
cleaned = dict(geoms)
6666

67-
for i, g in geoms.items():
67+
for i, g in list(geoms.items()):
6868
for j in list(cleaned.keys()):
6969
if i == j or i not in cleaned:
7070
continue

python/plugins/processing/algs/qgis/Difference.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Victor Olaya'
2122
__date__ = 'August 2012'

python/plugins/processing/algs/qgis/ExtractByLocation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Victor Olaya'
2122
__date__ = 'August 2012'

python/plugins/processing/algs/qgis/HubDistanceLines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Michael Minn'
2122
__date__ = 'May 2010'

python/plugins/processing/algs/qgis/HubDistancePoints.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Michael Minn'
2122
__date__ = 'May 2010'

python/plugins/processing/algs/qgis/HypsometricCurves.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def calculateHypsometry(self, fid, fName, progress, data, pX, pY,
197197
else:
198198
multiplier = pX * pY
199199

200-
for k, v in out.items():
200+
for k, v in list(out.items()):
201201
out[k] = v * multiplier
202202

203203
prev = None

python/plugins/processing/algs/qgis/Intersection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Victor Olaya'
2122
__date__ = 'August 2012'

python/plugins/processing/algs/qgis/LinesIntersection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Victor Olaya'
2122
__date__ = 'August 2012'

python/plugins/processing/algs/qgis/MeanCoords.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def processAlgorithm(self, progress):
124124

125125
current = 0
126126
total = 100.0 / len(means)
127-
for (clazz, values) in means.items():
127+
for (clazz, values) in list(means.items()):
128128
outFeat = QgsFeature()
129129
cx = values[0] / values[2]
130130
cy = values[1] / values[2]

python/plugins/processing/algs/qgis/NearestNeighbourAnalysis.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920
from builtins import str
2021

2122
__author__ = 'Victor Olaya'

python/plugins/processing/algs/qgis/PointDistance.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920
from builtins import str
2021
from builtins import range
2122

python/plugins/processing/algs/qgis/PointsDisplacement.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Alexander Bruy'
2122
__date__ = 'July 2013'
@@ -86,7 +87,7 @@ def processAlgorithm(self, progress):
8687
fullPerimeter = 2 * math.pi
8788

8889
request = QgsFeatureRequest()
89-
for (geom, fids) in duplicates.items():
90+
for (geom, fids) in list(duplicates.items()):
9091
count = len(fids)
9192
if count == 1:
9293
f = next(layer.getFeatures(request.setFilterFid(fids[0])))

python/plugins/processing/algs/qgis/PointsToPaths.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def processAlgorithm(self, progress):
106106

107107
current = 0
108108
total = 100.0 / len(points)
109-
for group, vertices in points.items():
109+
for group, vertices in list(points.items()):
110110
vertices.sort()
111111
f = QgsFeature()
112112
f.initAttributes(len(fields))

python/plugins/processing/algs/qgis/RandomExtract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def processAlgorithm(self, progress):
8181
"different value and try again."))
8282
value = int(round(value / 100.0000, 4) * featureCount)
8383

84-
selran = random.sample(range(featureCount), value)
84+
selran = random.sample(list(range(featureCount)), value)
8585

8686
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
8787
layer.fields().toList(), layer.wkbType(), layer.crs())

python/plugins/processing/algs/qgis/RandomPointsAlongLines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Alexander Bruy'
2122
__date__ = 'April 2014'

python/plugins/processing/algs/qgis/RandomPointsLayer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Alexander Bruy'
2122
__date__ = 'April 2014'

python/plugins/processing/algs/qgis/RandomSelection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def processAlgorithm(self, progress):
8989
"different value and try again."))
9090
value = int(round(value / 100.0, 4) * featureCount)
9191

92-
selran = random.sample(range(featureCount), value)
92+
selran = random.sample(list(range(featureCount)), value)
9393

9494
layer.selectByIds(selran)
9595
self.setOutputValue(self.OUTPUT, filename)

python/plugins/processing/algs/qgis/SelectByAttributeSum.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Alexander Bruy'
2122
__date__ = 'April 2015'

python/plugins/processing/algs/qgis/SelectByLocation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Victor Olaya'
2122
__date__ = 'August 2012'

python/plugins/processing/algs/qgis/SplitLinesWithLines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* *
1818
***************************************************************************
1919
"""
20+
from builtins import next
2021

2122
__author__ = 'Bernhard Ströbl'
2223
__date__ = 'November 2014'

python/plugins/processing/algs/qgis/SumLines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Victor Olaya'
2122
__date__ = 'August 2012'

python/plugins/processing/algs/qgis/Union.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Victor Olaya'
2122
__date__ = 'August 2012'

python/plugins/processing/algs/qgis/VoronoiPolygons.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from builtins import next
1920

2021
__author__ = 'Victor Olaya'
2122
__date__ = 'August 2012'
@@ -109,7 +110,7 @@ def processAlgorithm(self, progress):
109110
current = 0
110111
total = 100.0 / len(c.polygons)
111112

112-
for (site, edges) in c.polygons.items():
113+
for (site, edges) in list(c.polygons.items()):
113114
request = QgsFeatureRequest().setFilterFid(ptDict[ids[site]])
114115
inFeat = next(layer.getFeatures(request))
115116
lines = self.clip_voronoi(edges, c, width, height, extent, extraX, extraY)

python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def createEditor(self, parent, option, index):
248248
fieldType = FieldsMappingModel.columns[column]['type']
249249
if fieldType == QVariant.Type:
250250
editor = QComboBox(parent)
251-
for key, text in FieldsMappingModel.fieldTypes.items():
251+
for key, text in list(FieldsMappingModel.fieldTypes.items()):
252252
editor.addItem(text, key)
253253

254254
elif fieldType == QgsExpression:

python/plugins/processing/algs/qgis/voronoi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
***************************************************************************
1818
"""
1919
from __future__ import print_function
20+
from builtins import next
2021
from past.builtins import cmp
2122
from builtins import str
2223
from builtins import range

python/plugins/processing/core/GeoAlgorithm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def evaluateParameterValues(self):
329329
for param in self.parameters:
330330
try:
331331
param.evaluate(self)
332-
except ValueError, e:
332+
except ValueError as e:
333333
traceback.print_exc()
334334
raise GeoAlgorithmExecutionException(str(e))
335335

@@ -340,7 +340,7 @@ def resolveOutputs(self):
340340
try:
341341
for out in self.outputs:
342342
out.resolveValue(self)
343-
except ValueError, e:
343+
except ValueError as e:
344344
raise GeoAlgorithmExecutionException(str(e))
345345

346346
def setOutputCRS(self):

python/plugins/processing/core/ProcessingLog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def clearLog():
135135
def saveLog(fileName):
136136
entries = ProcessingLog.getLogEntries()
137137
with codecs.open(fileName, 'w', encoding='utf-8') as f:
138-
for k, v in entries.items():
138+
for k, v in list(entries.items()):
139139
for entry in v:
140140
f.write('%s|%s|%s\n' % (k, entry.date, entry.text))
141141

python/plugins/processing/core/outputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def getOutputFromString(s):
398398
try:
399399
if "|" in s:
400400
tokens = s.split("|")
401-
params = [t if unicode(t) != "None" else None for t in tokens[1:]]
401+
params = [t if str(t) != "None" else None for t in tokens[1:]]
402402
clazz = getattr(sys.modules[__name__], tokens[0])
403403
return clazz(*params)
404404
else:

0 commit comments

Comments
 (0)