Skip to content
Permalink
Browse files

Indentation

  • Loading branch information
nyalldawson committed Oct 21, 2016
1 parent f5d61ab commit 3cc9b5d962ebbe0ae7f0ed85787d6e8b172e6b87
@@ -109,7 +109,7 @@ def run(item, action, mainwindow):
uri = db.uri()

# Force use of estimated metadata (topologies can be big)
uri.setUseEstimatedMetadata( True )
uri.setUseEstimatedMetadata(True)

# FACES
group = legend.addGroup(u'Faces', False, supergroup)
@@ -87,7 +87,7 @@ def processAlgorithm(self, progress):
if geom.isMultipart():
points = geom.asMultiPoint()
else:
points = [ geom.asPoint() ]
points = [geom.asPoint()]
for n, point in enumerate(points):
x = point.x()
y = point.y()
@@ -68,7 +68,7 @@ def defineCharacteristics(self):
self.tr('Majority'): QgsZonalStatistics.Count,
self.tr('Variety'): QgsZonalStatistics.Count,
self.tr('All'): QgsZonalStatistics.All
}
}

self.name, self.i18n_name = self.trAlgorithm('Zonal Statistics (QGIS)')
self.group, self.i18n_group = self.trAlgorithm('Raster tools')
@@ -84,9 +84,9 @@ def defineCharacteristics(self):
self.addParameter(ParameterString(self.COLUMN_PREFIX,
self.tr('Output column prefix'), '_'))
self.addParameter(ParameterSelection(self.STATISTICS,
self.tr('Statistics to calculate'),
list(self.STATS.keys()),
multiple=True))
self.tr('Statistics to calculate'),
list(self.STATS.keys()),
multiple=True))
self.addOutput(OutputVector(self.OUTPUT_LAYER,
self.tr('Zonal statistics'),
True,
@@ -104,7 +104,7 @@ def processAlgorithm(self, progress):
keys = list(self.STATS.keys())
selectedStats = 0
for i in st:
selectedStats |= self.STATS[keys[i]]
selectedStats |= self.STATS[keys[i]]

zs = QgsZonalStatistics(vectorLayer,
rasterPath,
@@ -100,7 +100,7 @@ def initContext(self):
exp_context.lastScope().setVariable("row_number", 1)
exp_context.setHighlightedVariables(["row_number"])
self.builder.setExpressionContext(exp_context)

def updateLayer(self):
self.layer = dataobjects.getObject(self.cmbInputLayer.currentText())
self.builder.setLayer(self.layer)
@@ -392,7 +392,7 @@ def dump(self):
print("Site #%d (%g, %g)" % (self.sitenum, self.x, self.y))

def __eq__(self, other):
return (self.x==other.x) and (self.y==other.y)
return (self.x == other.x) and (self.y == other.y)

def __lt__(self, other):
if self.y < other.y:
@@ -507,7 +507,7 @@ def dump(self):
print("ystar: ", self.ystar)

def __eq__(self, other):
return (self.vertex.x==other.vertex.x) and (self.ystar==other.ystar)
return (self.vertex.x == other.vertex.x) and (self.ystar == other.ystar)

def __lt__(self, other):
if self.ystar < other.ystar:
@@ -138,7 +138,6 @@ def __init__(self, algType, alg):

self.editor.setLexerType(self.algType)


def showSnippets(self, evt):
popupmenu = QMenu()
for name, snippet in list(self.snippets.items()):
@@ -222,8 +221,8 @@ def saveScript(self, saveAs):
filterName = self.tr('Processing R script (*.rsx)')

self.filename = str(QFileDialog.getSaveFileName(self,
self.tr('Save script'), scriptDir,
filterName))
self.tr('Save script'), scriptDir,
filterName))

if self.filename:
if self.algType == self.SCRIPT_PYTHON and \
@@ -598,8 +598,6 @@ def _populate(self, widget):
items.append((getExtendedLayerName(layer), layer))
self.widget.update(items)



def refresh(self):
self._populate(self.widget)

0 comments on commit 3cc9b5d

Please sign in to comment.
You can’t perform that action at this time.