Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Jan 10, 2017
1 parent 21ad4ed commit 378212cf42654e7c50890701bd760b1d0b8667e9
@@ -84,7 +84,6 @@ def grassScriptFilename():
#~ # or something like that... This is just a temporary thing
#~ return '7.0.0'


@staticmethod
def installedVersion(run=False):
if Grass7Utils.isGrass7Installed and not run:
@@ -112,7 +111,6 @@ def installedVersion(run=False):

return Grass7Utils.version


@staticmethod
def grassPath():
if not isWindows() and not isMac():
@@ -73,41 +73,41 @@

rasterMenu = Processing.tr('&Raster')
projectionsMenu = rasterMenu + "/" + Processing.tr('Projections')
defaultMenuEntries.update({'gdal:warpreproject':projectionsMenu,
'gdal:assignprojection':projectionsMenu,
'gdal:extractprojection':projectionsMenu})
defaultMenuEntries.update({'gdal:warpreproject': projectionsMenu,
'gdal:assignprojection': projectionsMenu,
'gdal:extractprojection': projectionsMenu})
conversionMenu = rasterMenu + "/" + Processing.tr('Conversion')
defaultMenuEntries.update({'gdal:rasterize':conversionMenu,
'gdal:rasterize_over':conversionMenu,
'gdal:polygonize':conversionMenu,
'gdal:translate':conversionMenu,
'gdal:rgbtopct':conversionMenu,
'gdal:pcttorgb':conversionMenu})
defaultMenuEntries.update({'gdal:rasterize': conversionMenu,
'gdal:rasterize_over': conversionMenu,
'gdal:polygonize': conversionMenu,
'gdal:translate': conversionMenu,
'gdal:rgbtopct': conversionMenu,
'gdal:pcttorgb': conversionMenu})
extractionMenu = rasterMenu + "/" + Processing.tr('Extraction')
defaultMenuEntries.update({'gdal:contour':extractionMenu,
'gdal:cliprasterbyextent':extractionMenu,
'gdal:cliprasterbymasklayer':extractionMenu})
defaultMenuEntries.update({'gdal:contour': extractionMenu,
'gdal:cliprasterbyextent': extractionMenu,
'gdal:cliprasterbymasklayer': extractionMenu})
analysisMenu = rasterMenu + "/" + Processing.tr('Analysis')
defaultMenuEntries.update({'gdal:sieve':analysisMenu,
'gdal:nearblack':analysisMenu,
'gdal:fillnodata':analysisMenu,
'gdal:proximity':analysisMenu,
'gdal:griddatametrics':analysisMenu,
'gdal:gridaverage':analysisMenu,
'gdal:gridinvdist':analysisMenu,
'gdal:gridnearestneighbor':analysisMenu,
'gdal:aspect':analysisMenu,
'gdal:hillshade':analysisMenu,
'gdal:roughness':analysisMenu,
'gdal:slope':analysisMenu,
'gdal:tpi':analysisMenu,
'gdal:tri':analysisMenu})
defaultMenuEntries.update({'gdal:sieve': analysisMenu,
'gdal:nearblack': analysisMenu,
'gdal:fillnodata': analysisMenu,
'gdal:proximity': analysisMenu,
'gdal:griddatametrics': analysisMenu,
'gdal:gridaverage': analysisMenu,
'gdal:gridinvdist': analysisMenu,
'gdal:gridnearestneighbor': analysisMenu,
'gdal:aspect': analysisMenu,
'gdal:hillshade': analysisMenu,
'gdal:roughness': analysisMenu,
'gdal:slope': analysisMenu,
'gdal:tpi': analysisMenu,
'gdal:tri': analysisMenu})
miscMenu = rasterMenu + "/" + Processing.tr('Miscellaneous')
defaultMenuEntries.update({'gdal:buildvirtualraster':miscMenu,
'gdal:merge':miscMenu,
'gdal:rasterinfo':miscMenu,
'gdal:overviews':miscMenu,
'gdal:tileindex':miscMenu})
defaultMenuEntries.update({'gdal:buildvirtualraster': miscMenu,
'gdal:merge': miscMenu,
'gdal:rasterinfo': miscMenu,
'gdal:overviews': miscMenu,
'gdal:tileindex': miscMenu})


def initializeMenus():
@@ -98,7 +98,7 @@ def features(layer, request=QgsFeatureRequest()):
class Features(object):

DO_NOT_CHECK, IGNORE, RAISE_EXCEPTION = range(3)

def __init__(self, layer, request):
self.layer = layer
self.selection = False
@@ -108,24 +108,24 @@ def __init__(self, layer, request):
self.selection = True
else:
self.iter = layer.getFeatures(request)

invalidFeaturesMethod = ProcessingConfig.getSetting(ProcessingConfig.FILTER_INVALID_GEOMETRIES)

def filterFeature(f, ignoreInvalid):
geom = f.geometry()
if geom is None:
ProcessingLog.addToLog(ProcessingLog.LOG_INFO,
self.tr('Feature with NULL geometry found.'))
self.tr('Feature with NULL geometry found.'))
elif not geom.isGeosValid():
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr('GEOS geoprocessing error: One or more input features have invalid geometry.'))
self.tr('GEOS geoprocessing error: One or more input features have invalid geometry.'))
if ignoreInvalid:
return False
else:
raise GeoAlgorithmExecutionException(self.tr('Features with invalid geometries found. Please fix these geometries or specify the "Ignore invalid input features" flag'))
return True

if invalidFeaturesMethod == self.IGNORE:
if invalidFeaturesMethod == self.IGNORE:
self.iter = filter(lambda x: filterFeature(x, True), self.iter)
elif invalidFeaturesMethod == self.RAISE_EXCEPTION:
self.iter = filter(lambda x: filterFeature(x, False), self.iter)
@@ -138,11 +138,10 @@ def __len__(self):
return int(self.layer.selectedFeatureCount())
else:
return int(self.layer.featureCount())

def tr(self, string):
return QCoreApplication.translate("FeatureIterator", string)


return Features(layer, request)


0 comments on commit 378212c

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