Skip to content

Commit cbe8cb7

Browse files
committedJan 29, 2016
Formatting update, using newer autopep8 version
1 parent 4a3d3db commit cbe8cb7

39 files changed

+128
-128
lines changed
 

‎python/console/console_sci.py

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 15 additions & 15 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 7 additions & 7 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 13 additions & 13 deletions
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

Lines changed: 19 additions & 19 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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):

‎python/plugins/processing/gui/NumberInputDialog.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ def fillTree(self):
6868
layerItem = QTreeWidgetItem()
6969
layerItem.setText(0, unicode(layer.name()))
7070
layerItem.addChild(TreeValueItem(self.tr('Min X'),
71-
layer.extent().xMinimum()))
71+
layer.extent().xMinimum()))
7272
layerItem.addChild(TreeValueItem(self.tr('Max X'),
73-
layer.extent().xMaximum()))
73+
layer.extent().xMaximum()))
7474
layerItem.addChild(TreeValueItem(self.tr('Min Y'),
75-
layer.extent().yMinimum()))
75+
layer.extent().yMinimum()))
7676
layerItem.addChild(TreeValueItem(self.tr('Max Y'),
77-
layer.extent().yMaximum()))
77+
layer.extent().yMaximum()))
7878
if isinstance(layer, QgsRasterLayer):
7979
cellsize = (layer.extent().xMaximum()
8080
- layer.extent().xMinimum()) / layer.width()
@@ -93,11 +93,11 @@ def fillTree(self):
9393
layerItem.setText(0, unicode(layer.name()))
9494
layerItem.addChild(TreeValueItem(self.tr('Mean'), stats.mean))
9595
layerItem.addChild(TreeValueItem(self.tr('Std. deviation'),
96-
stats.stdDev))
96+
stats.stdDev))
9797
layerItem.addChild(TreeValueItem(self.tr('Max value'),
98-
stats.maximumValue))
98+
stats.maximumValue))
9999
layerItem.addChild(TreeValueItem(self.tr('Min value'),
100-
stats.minimumValue))
100+
stats.minimumValue))
101101
layersItem.addChild(layerItem)
102102

103103
canvasItem = QTreeWidgetItem()

‎python/plugins/processing/gui/ScriptEdit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def initLexer(self):
192192

193193
settings = QSettings()
194194
useDefaultAPI = bool(settings.value('pythonConsole/preloadAPI',
195-
True))
195+
True))
196196
if useDefaultAPI:
197197
# Load QGIS API shipped with Python console
198198
self.api.loadPrepared(

‎python/plugins/processing/gui/ScriptEditorDialog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ def saveScript(self, saveAs):
228228
filterName = self.tr('Processing R script (*.rsx)')
229229

230230
self.filename = unicode(QFileDialog.getSaveFileName(self,
231-
self.tr('Save script'), scriptDir,
232-
filterName))
231+
self.tr('Save script'), scriptDir,
232+
filterName))
233233

234234
if self.filename:
235235
if self.algType == self.SCRIPT_PYTHON and \

‎python/plugins/processing/modeler/CalculatorModelerAlgorithm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def defineCharacteristics(self):
5454
self.tr('Formula', 'CalculatorModelerAlgorithm'), ''))
5555
for i in range(AVAILABLE_VARIABLES):
5656
self.addParameter(ParameterNumber(NUMBER
57-
+ unicode(i), 'dummy'))
57+
+ unicode(i), 'dummy'))
5858
self.addOutput(OutputNumber(RESULT,
5959
self.tr('Result', 'CalculatorModelerAlgorithm')))
6060

‎python/plugins/processing/modeler/ModelerArrowItem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(self, startItem, startIndex, endItem, endIndex,
6666
self.setFlag(QGraphicsItem.ItemIsSelectable, False)
6767
self.myColor = Qt.gray
6868
self.setPen(QPen(self.myColor, 1, Qt.SolidLine,
69-
Qt.RoundCap, Qt.RoundJoin))
69+
Qt.RoundCap, Qt.RoundJoin))
7070
self.setZValue(0)
7171

7272
def updatePath(self):

‎python/plugins/processing/modeler/ModelerGraphicItem.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@ def paint(self, painter, option, widget=None):
263263
painter.drawText(pt, 'Out')
264264
if not self.element.outputsFolded:
265265
for i, out in enumerate(self.element.algorithm.outputs):
266-
text = self.getAdjustedText(out.description)
267-
h = fm.height() * 1.2 * (i + 2)
268-
h = h + ModelerGraphicItem.BOX_HEIGHT / 2.0
269-
pt = QPointF(-ModelerGraphicItem.BOX_WIDTH / 2
270-
+ 33, h)
271-
painter.drawText(pt, text)
266+
text = self.getAdjustedText(out.description)
267+
h = fm.height() * 1.2 * (i + 2)
268+
h = h + ModelerGraphicItem.BOX_HEIGHT / 2.0
269+
pt = QPointF(-ModelerGraphicItem.BOX_WIDTH / 2
270+
+ 33, h)
271+
painter.drawText(pt, text)
272272
if self.pixmap:
273273
painter.drawPixmap(-(ModelerGraphicItem.BOX_WIDTH / 2.0) + 3, -8,
274274
self.pixmap)
@@ -354,11 +354,11 @@ def paint(self, painter, option, widget=None):
354354
if self.isIn:
355355
painter.setPen(QPen(Qt.transparent, 1))
356356
painter.setBrush(QBrush(Qt.lightGray,
357-
Qt.SolidPattern))
357+
Qt.SolidPattern))
358358
else:
359359
painter.setPen(QPen(Qt.transparent, 1))
360360
painter.setBrush(QBrush(Qt.transparent,
361-
Qt.SolidPattern))
361+
Qt.SolidPattern))
362362
painter.drawRect(rect)
363363
painter.drawPixmap(pt.x(), pt.y(), self.pixmap)
364364

‎python/plugins/processing/modeler/RasterLayerBoundsAlgorithm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ def processAlgorithm(self, progress):
6161
self.setOutputValue(self.YMIN, layer.extent().yMinimum())
6262
self.setOutputValue(self.YMAX, layer.extent().yMaximum())
6363
self.setOutputValue(self.EXTENT, (layer.extent().xMinimum(),
64-
layer.extent().xMaximum(),
65-
layer.extent().yMinimum(),
66-
layer.extent().yMaximum()))
64+
layer.extent().xMaximum(),
65+
layer.extent().yMinimum(),
66+
layer.extent().yMaximum()))

‎python/plugins/processing/modeler/VectorLayerBoundsAlgorithm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ def processAlgorithm(self, progress):
6161
self.setOutputValue(self.YMIN, layer.extent().yMinimum())
6262
self.setOutputValue(self.YMAX, layer.extent().yMaximum())
6363
self.setOutputValue(self.EXTENT, (layer.extent().xMinimum(),
64-
layer.extent().xMaximum(),
65-
layer.extent().yMinimum(),
66-
layer.extent().yMaximum()))
64+
layer.extent().xMaximum(),
65+
layer.extent().yMinimum(),
66+
layer.extent().yMaximum()))

‎python/plugins/processing/script/ScriptAlgorithmProvider.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ class ScriptAlgorithmProvider(AlgorithmProvider):
4646
def __init__(self):
4747
AlgorithmProvider.__init__(self)
4848
self.actions.extend([CreateNewScriptAction(self.tr('Create new script', 'ScriptAlgorithmProvider'),
49-
CreateNewScriptAction.SCRIPT_PYTHON),
50-
AddScriptFromFileAction(),
51-
GetScriptsAction()])
49+
CreateNewScriptAction.SCRIPT_PYTHON),
50+
AddScriptFromFileAction(),
51+
GetScriptsAction()])
5252
self.contextMenuActions = \
5353
[EditScriptAction(EditScriptAction.SCRIPT_PYTHON),
5454
DeleteScriptAction(DeleteScriptAction.SCRIPT_PYTHON)]
5555

5656
def initializeSettings(self):
5757
AlgorithmProvider.initializeSettings(self)
5858
ProcessingConfig.addSetting(Setting(self.getDescription(),
59-
ScriptUtils.SCRIPTS_FOLDER,
60-
self.tr('Scripts folder', 'ScriptAlgorithmProvider'),
61-
ScriptUtils.scriptsFolder(), valuetype=Setting.FOLDER))
59+
ScriptUtils.SCRIPTS_FOLDER,
60+
self.tr('Scripts folder', 'ScriptAlgorithmProvider'),
61+
ScriptUtils.scriptsFolder(), valuetype=Setting.FOLDER))
6262

6363
def unload(self):
6464
AlgorithmProvider.unload(self)

‎python/plugins/processing/tests/qgis_interface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self, canvas):
4747
self.testVector])
4848

4949
self.statusBar = type('FakeStatusBar', (), {'showMessage': lambda _,
50-
m: None})()
50+
m: None})()
5151

5252
def zoomFull(self):
5353
"""Zoom to the map full extent"""
@@ -98,12 +98,12 @@ def mainWindow(self):
9898
"""
9999

100100
return type('FakeMainWindow', (), {'statusBar': lambda _:
101-
self.statusBar})()
101+
self.statusBar})()
102102

103103
def addDockWidget(self, area, dockwidget):
104104
"""Add a dock widget to the main window"""
105105
pass
106106

107107
def legendInterface(self):
108108
return type('FakeLInterface', (), {'layers': lambda _:
109-
[self.testRaster, self.testVector]})()
109+
[self.testRaster, self.testVector]})()

‎python/plugins/processing/tests/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(
9090
self.alg = alg
9191
self.threaded = threaded
9292
self.msg = 'ALG %s (%s %s)' % (self.algId, {True: 'threaded',
93-
False: 'unthreaded'}[threaded], dialog)
93+
False: 'unthreaded'}[threaded], dialog)
9494
unittest.TestCase.__init__(self, 'runalg_%s' % dialog)
9595

9696
def gen_test_parameters(self, alg, doSet=False):

‎python/plugins/processing/tools/vector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def _runSQL(sql):
592592
_runSQL("CREATE TABLE %s.%s (%s)" % (uri.schema(), uri.table().lower(), fieldsdesc))
593593
_runSQL("SELECT AddGeometryColumn('{schema}', '{table}', 'the_geom', {srid}, '{typmod}', 2)".format(
594594
table=uri.table().lower(), schema=uri.schema(), srid=crs.authid().split(":")[-1],
595-
typmod=GEOM_TYPE_MAP[geometryType].upper()))
595+
typmod=GEOM_TYPE_MAP[geometryType].upper()))
596596

597597
self.layer = QgsVectorLayer(uri.uri(), uri.table(), "postgres")
598598
self.writer = self.layer.dataProvider()
@@ -622,7 +622,7 @@ def _runSQL(sql):
622622
_runSQL("CREATE TABLE %s (%s)" % (uri.table().lower(), fieldsdesc))
623623
_runSQL("SELECT AddGeometryColumn('{table}', 'the_geom', {srid}, '{typmod}', 2)".format(
624624
table=uri.table().lower(), srid=crs.authid().split(":")[-1],
625-
typmod=GEOM_TYPE_MAP[geometryType].upper()))
625+
typmod=GEOM_TYPE_MAP[geometryType].upper()))
626626

627627
self.layer = QgsVectorLayer(uri.uri(), uri.table(), "spatialite")
628628
self.writer = self.layer.dataProvider()

‎python/pyplugin_installer/installer_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def xmlDownloaded(self):
450450
#if compatible, add the plugin to the list
451451
if not pluginNodes.item(i).firstChildElement("disabled").text().strip().upper() in ["TRUE", "YES"]:
452452
if isCompatible(QGis.QGIS_VERSION, qgisMinimumVersion, qgisMaximumVersion):
453-
#add the plugin to the cache
453+
#add the plugin to the cache
454454
plugins.addFromRepository(plugin)
455455
self.mRepositories[reposName]["state"] = 2
456456
else:

‎src/plugins/grass/scripts/r.external.all.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@
8888
def import_directory_of_rasters(directory, recursive):
8989
for dir, dirnames, filenames in os.walk(directory):
9090
for filename in filenames:
91-
if grass.run_command('r.external', flags=flags_string, input=os.path.join(dir, filename), band=options['band'], output=filename[:-4], title=filename[:-4]) != 0:
92-
grass.warning('Cannot import file' + filename)
91+
if grass.run_command('r.external', flags=flags_string, input=os.path.join(dir, filename), band=options['band'], output=filename[:-4], title=filename[:-4]) != 0:
92+
grass.warning('Cannot import file' + filename)
9393
if not recursive:
94-
break
94+
break
9595
for dirname in dirnames:
96-
import_directory_of_rasters(dirname, recursive)
96+
import_directory_of_rasters(dirname, recursive)
9797

9898

9999
def main():

0 commit comments

Comments
 (0)
Please sign in to comment.