Skip to content

Commit cbe8cb7

Browse files
committed
Formatting update, using newer autopep8 version
1 parent 4a3d3db commit cbe8cb7

39 files changed

+128
-128
lines changed

python/console/console_sci.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def keyPressEvent(self, e):
449449
return
450450
elif t == '(' and (re.match(r'^[ \t]*def \w+$', txt)
451451
or re.match(r'^[ \t]*class \w+$', txt)):
452-
self.insert('):')
452+
self.insert('):')
453453
else:
454454
self.insert(self.closing[i])
455455
## FIXES #8392 (automatically removes the redundant char

python/custom_widgets/qgis_customwidgets.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848

4949

5050
def moduleInformation():
51-
try:
52-
import qgis.gui
53-
return "qgis.gui", dir(qgis.gui)
54-
except ImportError:
55-
return "", []
51+
try:
52+
import qgis.gui
53+
return "qgis.gui", dir(qgis.gui)
54+
except ImportError:
55+
return "", []

python/plugins/MetaSearch/plugin.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ def initGui(self):
5757
self.action_run = QAction(run_icon, 'MetaSearch',
5858
self.iface.mainWindow())
5959
self.action_run.setWhatsThis(QCoreApplication.translate('MetaSearch',
60-
'MetaSearch plugin'))
60+
'MetaSearch plugin'))
6161
self.action_run.setStatusTip(QCoreApplication.translate('MetaSearch',
62-
'Search Metadata Catalogues'))
62+
'Search Metadata Catalogues'))
6363

6464
self.action_run.triggered.connect(self.run)
6565

@@ -70,9 +70,9 @@ def initGui(self):
7070
help_icon = QIcon('%s/%s' % (self.context.ppath, 'images/help.png'))
7171
self.action_help = QAction(help_icon, 'Help', self.iface.mainWindow())
7272
self.action_help.setWhatsThis(QCoreApplication.translate('MetaSearch',
73-
'MetaSearch plugin help'))
73+
'MetaSearch plugin help'))
7474
self.action_help.setStatusTip(QCoreApplication.translate('MetaSearch',
75-
'Get Help on MetaSearch'))
75+
'Get Help on MetaSearch'))
7676
self.action_help.triggered.connect(self.help)
7777

7878
self.iface.addPluginToWebMenu(self.web_menu, self.action_help)

python/plugins/db_manager/db_plugins/oracle/info_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def connectionDetails(self):
5050
tbl.append((QApplication.translate("DBManagerPlugin", "Host:"),
5151
self.db.connector.host))
5252
tbl.append((QApplication.translate("DBManagerPlugin", "Database:"),
53-
self.db.connector.dbname))
53+
self.db.connector.dbname))
5454
tbl.append((QApplication.translate("DBManagerPlugin", "User:"),
5555
self.db.connector.user))
5656
tbl.append((QApplication.translate("DBManagerPlugin",

python/plugins/fTools/tools/doEliminate.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -174,24 +174,24 @@ def eliminate(self, inLayer, boundary, progressBar, outFileName):
174174

175175
selFeat = QgsFeature()
176176
while fit.nextFeature(selFeat):
177-
selGeom = selFeat.geometry()
177+
selGeom = selFeat.geometry()
178178

179-
if geom2Eliminate.intersects(selGeom): # we have a candidate
180-
iGeom = geom2Eliminate.intersection(selGeom)
179+
if geom2Eliminate.intersects(selGeom): # we have a candidate
180+
iGeom = geom2Eliminate.intersection(selGeom)
181181

182-
if boundary:
183-
selValue = iGeom.length()
182+
if boundary:
183+
selValue = iGeom.length()
184+
else:
185+
# we need a common boundary
186+
if 0 < iGeom.length():
187+
selValue = selGeom.area()
184188
else:
185-
# we need a common boundary
186-
if 0 < iGeom.length():
187-
selValue = selGeom.area()
188-
else:
189-
selValue = 0
190-
191-
if selValue > max:
192-
max = selValue
193-
mergeWithFid = selFeat.id()
194-
mergeWithGeom = QgsGeometry(selGeom) # deep copy of the geometry
189+
selValue = 0
190+
191+
if selValue > max:
192+
max = selValue
193+
mergeWithFid = selFeat.id()
194+
mergeWithGeom = QgsGeometry(selGeom) # deep copy of the geometry
195195

196196
if mergeWithFid is not None: # a successful candidate
197197
newGeom = mergeWithGeom.combine(geom2Eliminate)

python/plugins/fTools/tools/doValidate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def closeEvent(self, e):
112112

113113
def keyPressEvent(self, e):
114114
if (e.modifiers() == Qt.ControlModifier or
115-
e.modifiers() == Qt.MetaModifier ) and \
115+
e.modifiers() == Qt.MetaModifier ) and \
116116
e.key() == Qt.Key_C:
117117
items = ""
118118
for row in range(self.tblUnique.rowCount()):

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def defineCharacteristics(self):
7070
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction')
7171
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
7272
self.addParameter(ParameterVector(self.MASK, self.tr('Mask layer'),
73-
[ParameterVector.VECTOR_TYPE_POLYGON]))
73+
[ParameterVector.VECTOR_TYPE_POLYGON]))
7474
self.addParameter(ParameterString(self.NO_DATA,
7575
self.tr("Nodata value, leave blank to take the nodata value from input"),
7676
'-9999'))

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def defineCharacteristics(self):
4848
self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous')
4949

5050
self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer'),
51-
[ParameterVector.VECTOR_TYPE_ANY], False))
51+
[ParameterVector.VECTOR_TYPE_ANY], False))
5252
self.addParameter(ParameterBoolean(self.SUMMARY_ONLY,
5353
self.tr('Summary output only'),
5454
True))

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def defineCharacteristics(self):
5252
self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous')
5353

5454
self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer'),
55-
[ParameterVector.VECTOR_TYPE_ANY], False))
55+
[ParameterVector.VECTOR_TYPE_ANY], False))
5656
self.addParameter(ParameterString(self.SQL, self.tr('SQL'), ''))
5757

5858
self.addParameter(ParameterSelection(

python/plugins/processing/algs/grass7/nviz7.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def getDefaultCellsize(self):
165165
else:
166166
layer = dataobjects.getObjectFromUri(param.value)
167167
cellsize = max(cellsize, (layer.extent().xMaximum()
168-
- layer.extent().xMinimum())
168+
- layer.extent().xMinimum())
169169
/ layer.width())
170170
elif isinstance(param, ParameterMultipleInput):
171171

python/plugins/processing/algs/lidar/LidarToolsAlgorithmProvider.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def _loadAlgorithms(self):
200200
Catalog(), CloudMetrics(), CanopyMaxima(), CanopyModel(), ClipData(),
201201
Csv2Grid(), Cover(), FilterData(), GridMetrics(), GroundFilter(),
202202
GridSurfaceCreate(), MergeData(), TinSurfaceCreate(), PolyClipData(),
203-
DTM2TIF(), FirstLastReturn(), ASCII2DTM()
203+
DTM2TIF(), FirstLastReturn(), ASCII2DTM()
204204
]
205205
for alg in fusiontools:
206206
alg.group, alg.i18n_group = alg.trAlgorithm('Fusion')

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def processAlgorithm(self, progress):
8181
provider = layer.dataProvider()
8282
fields = provider.fields()
8383
fields.append(QgsField(fieldName, self.TYPES[fieldType], '',
84-
fieldLength, fieldPrecision))
84+
fieldLength, fieldPrecision))
8585
writer = output.getVectorWriter(fields, provider.geometryType(),
8686
layer.crs())
8787
outFeat = QgsFeature()

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def layerExtent(self, layer, writer, progress):
9494
perim = 2 * width + 2 * height
9595

9696
rect = [QgsPoint(minx, miny), QgsPoint(minx, maxy), QgsPoint(maxx,
97-
maxy), QgsPoint(maxx, miny), QgsPoint(minx, miny)]
97+
maxy), QgsPoint(maxx, miny), QgsPoint(minx, miny)]
9898
geometry = QgsGeometry().fromPolygon([rect])
9999
feat = QgsFeature()
100100
feat.setGeometry(geometry)
@@ -131,7 +131,7 @@ def featureExtent(self, layer, writer, progress):
131131
area = width * height
132132
perim = 2 * width + 2 * height
133133
rect = [QgsPoint(minx, miny), QgsPoint(minx, maxy), QgsPoint(maxx,
134-
maxy), QgsPoint(maxx, miny), QgsPoint(minx, miny)]
134+
maxy), QgsPoint(maxx, miny), QgsPoint(minx, miny)]
135135

136136
geometry = QgsGeometry().fromPolygon([rect])
137137
feat.setGeometry(geometry)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def processAlgorithm(self, progress):
9191
provider = layer.dataProvider()
9292
fields = provider.fields()
9393
fields.append(QgsField(fieldName, self.TYPES[fieldType], '',
94-
fieldLength, fieldPrecision))
94+
fieldLength, fieldPrecision))
9595
writer = output.getVectorWriter(fields, provider.geometryType(),
9696
layer.crs())
9797
outFeat = QgsFeature()

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def linearMatrix(self, inLayer, inField, targetLayer, targetField,
145145
vari += (i - mean) * (i - mean)
146146
vari = math.sqrt(vari / len(distList))
147147
self.writer.addRecord([inID, unicode(mean),
148-
unicode(vari), unicode(min(distList)),
149-
unicode(max(distList))])
148+
unicode(vari), unicode(min(distList)),
149+
unicode(max(distList))])
150150

151151
current += 1
152152
progress.setPercentage(int(current * total))

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def processAlgorithm(self, progress):
9797
outFeat.setGeometry(QgsGeometry.fromWkt(polygon.wkt))
9898
if self.getParameterValue(self.GEOMETRY):
9999
outFeat.setAttributes([None] * fieldsCount + [polygon.area,
100-
polygon.length])
100+
polygon.length])
101101
writer.addFeature(outFeat)
102102
current += 1
103103
progress.setPercentage(50 + int(current * total))

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def processAlgorithm(self, progress):
9393

9494
outFeat.setAttributes(attrs)
9595
outGeom = QgsGeometry(self.convertGeometry(multi_feature,
96-
vType))
96+
vType))
9797
outFeat.setGeometry(outGeom)
9898
writer.addFeature(outFeat)
9999

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def processAlgorithm(self, progress):
6363
self.createHTML(outputFile, values)
6464
self.setOutputValue(self.TOTAL_VALUES, len(values))
6565
self.setOutputValue(self.UNIQUE_VALUES, ';'.join([unicode(v) for v in
66-
values]))
66+
values]))
6767

6868
def createHTML(self, outputFile, algData):
6969
f = codecs.open(outputFile, 'w', encoding='utf-8')

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def processAlgorithm(self, progress):
9393
uniqueSet = Set(item for item in pts)
9494
ids = [pts.index(item) for item in uniqueSet]
9595
sl = voronoi.SiteList([voronoi.Site(i[0], i[1], sitenum=j) for (j,
96-
i) in enumerate(uniqueSet)])
96+
i) in enumerate(uniqueSet)])
9797
voronoi.voronoi(sl, c)
9898
inFeat = QgsFeature()
9999

@@ -223,9 +223,9 @@ def clip_line(x1, y1, x2, y2, w, h, x, y):
223223
)
224224
if x1 or x2 or y1 or y2:
225225
lines.append(QgsPoint(x1 + extent.xMinimum(), y1
226-
+ extent.yMinimum()))
226+
+ extent.yMinimum()))
227227
lines.append(QgsPoint(x2 + extent.xMinimum(), y2
228-
+ extent.yMinimum()))
228+
+ extent.yMinimum()))
229229
if 0 - exX in (x1, x2):
230230
hasXMin = True
231231
if 0 - exY in (y1, y2):
@@ -237,15 +237,15 @@ def clip_line(x1, y1, x2, y2, w, h, x, y):
237237
if hasXMin:
238238
if hasYMax:
239239
lines.append(QgsPoint(extent.xMinimum() - exX, height
240-
+ extent.yMinimum() + exY))
240+
+ extent.yMinimum() + exY))
241241
if hasYMin:
242242
lines.append(QgsPoint(extent.xMinimum() - exX,
243-
extent.yMinimum() - exY))
243+
extent.yMinimum() - exY))
244244
if hasXMax:
245245
if hasYMax:
246246
lines.append(QgsPoint(width + extent.xMinimum() + exX, height
247-
+ extent.yMinimum() + exY))
247+
+ extent.yMinimum() + exY))
248248
if hasYMin:
249249
lines.append(QgsPoint(width + extent.xMinimum() + exX,
250-
extent.yMinimum() - exY))
250+
extent.yMinimum() - exY))
251251
return lines

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def list_geotables(self, schema=None):
295295
def get_table_rows(self, table, schema=None):
296296
c = self.con.cursor()
297297
self._exec_sql(c, 'SELECT COUNT(*) FROM %s' % self._table_name(schema,
298-
table))
298+
table))
299299
return c.fetchone()[0]
300300

301301
def get_table_fields(self, table, schema=None):

python/plugins/processing/algs/qgis/scripts/Fill_holes.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@
2222
resfeat = QgsFeature()
2323

2424
for feat in processing.features(polyLayer):
25-
progress.setPercentage(int(100 * l / n))
26-
l += 1
25+
progress.setPercentage(int(100 * l / n))
26+
l += 1
2727

28-
g = loads(feat.geometry().asWkb())
28+
g = loads(feat.geometry().asWkb())
2929

30-
if g.geom_type == 'MultiPolygon':
31-
resg = [Polygon(p.exterior,
32-
[r for r in p.interiors if Polygon(r).area > Max_area]) for p in g]
30+
if g.geom_type == 'MultiPolygon':
31+
resg = [Polygon(p.exterior,
32+
[r for r in p.interiors if Polygon(r).area > Max_area]) for p in g]
3333

34-
else:
35-
resg = [Polygon(g.exterior,
36-
[r for r in g.interiors if Polygon(r).area > Max_area])]
34+
else:
35+
resg = [Polygon(g.exterior,
36+
[r for r in g.interiors if Polygon(r).area > Max_area])]
3737

38-
resgeom = QgsGeometry().fromWkt(dumps(MultiPolygon(resg)))
38+
resgeom = QgsGeometry().fromWkt(dumps(MultiPolygon(resg)))
3939

40-
resfeat.setAttributes(feat.attributes())
41-
resfeat.setGeometry(resgeom)
42-
writer.addFeature(resfeat)
40+
resfeat.setAttributes(feat.attributes())
41+
resfeat.setGeometry(resgeom)
42+
writer.addFeature(resfeat)
4343

4444
del writer

python/plugins/processing/algs/qgis/scripts/Keep_n_biggest_parts.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
To_keep = int(To_keep)
1010
if To_keep < 1:
11-
progress.setInfo("'To keep' value has been modified to be at least 1.")
12-
To_keep = 1
11+
progress.setInfo("'To keep' value has been modified to be at least 1.")
12+
To_keep = 1
1313

1414

1515
polyLayer = processing.getObject(Polygons)
@@ -20,23 +20,23 @@
2020

2121

2222
for n, feat in enumerate(processing.features(polyLayer)):
23-
progress.setPercentage(int(100 * n / count))
24-
geom = feat.geometry()
25-
if geom.isMultipart():
26-
featres = feat
27-
geoms = geom.asGeometryCollection()
28-
geomarea = [(i, geoms[i].area()) for i in range(len(geoms))]
29-
geomarea.sort(key=itemgetter(1))
30-
if To_keep == 1:
31-
featres.setGeometry(geoms[geomarea[-1][0]])
32-
elif To_keep > len(geoms):
33-
featres.setGeometry(geom)
34-
else:
35-
featres.setGeometry(geom)
36-
geomres = [geoms[i].asPolygon() for i, a in geomarea[-1 * To_keep:]]
37-
featres.setGeometry(QgsGeometry.fromMultiPolygon(geomres))
38-
writer.addFeature(featres)
23+
progress.setPercentage(int(100 * n / count))
24+
geom = feat.geometry()
25+
if geom.isMultipart():
26+
featres = feat
27+
geoms = geom.asGeometryCollection()
28+
geomarea = [(i, geoms[i].area()) for i in range(len(geoms))]
29+
geomarea.sort(key=itemgetter(1))
30+
if To_keep == 1:
31+
featres.setGeometry(geoms[geomarea[-1][0]])
32+
elif To_keep > len(geoms):
33+
featres.setGeometry(geom)
3934
else:
40-
writer.addFeature(feat)
35+
featres.setGeometry(geom)
36+
geomres = [geoms[i].asPolygon() for i, a in geomarea[-1 * To_keep:]]
37+
featres.setGeometry(QgsGeometry.fromMultiPolygon(geomres))
38+
writer.addFeature(featres)
39+
else:
40+
writer.addFeature(feat)
4141

4242
del writer

python/plugins/processing/algs/r/RAlgorithm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def getImportCommands(self):
342342
commands.append(param.name + ' <- read.csv("' + value
343343
+ '", head=TRUE, sep=",")')
344344
elif isinstance(param, (ParameterTableField, ParameterString,
345-
ParameterFile)):
345+
ParameterFile)):
346346
commands.append(param.name + '="' + param.value + '"')
347347
elif isinstance(param, (ParameterNumber, ParameterSelection)):
348348
commands.append(param.name + '=' + unicode(param.value))

python/plugins/processing/algs/saga/SagaAlgorithm213.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def processAlgorithm(self, progress):
121121
if param.value is None:
122122
continue
123123
if isinstance(param, (ParameterRaster, ParameterVector,
124-
ParameterTable)):
124+
ParameterTable)):
125125
value = param.value
126126
if value in self.exportedLayers.keys():
127127
command += ' -' + param.name + ' "' \

python/plugins/processing/core/ProcessingConfig.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ def initialize():
137137
ProcessingConfig.tr('General'),
138138
ProcessingConfig.DEFAULT_OUTPUT_VECTOR_LAYER_EXT,
139139
ProcessingConfig.tr('Default output vector layer extension'), extensions[0],
140-
valuetype=Setting.SELECTION, options=extensions))
140+
valuetype=Setting.SELECTION, options=extensions))
141141
extensions = processing.tools.dataobjects.getSupportedOutputRasterLayerExtensions()
142142
ProcessingConfig.addSetting(Setting(
143143
ProcessingConfig.tr('General'),
144144
ProcessingConfig.DEFAULT_OUTPUT_RASTER_LAYER_EXT,
145145
ProcessingConfig.tr('Default output raster layer extension'), extensions[0],
146-
valuetype=Setting.SELECTION, options=extensions))
146+
valuetype=Setting.SELECTION, options=extensions))
147147

148148
@staticmethod
149149
def setGroupIcon(group, icon):

0 commit comments

Comments
 (0)