Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 10, 2017
1 parent 21ad4ed commit 378212c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 41 deletions.
2 changes: 0 additions & 2 deletions python/plugins/processing/algs/grass7/Grass7Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -112,7 +111,6 @@ def installedVersion(run=False):

return Grass7Utils.version


@staticmethod
def grassPath():
if not isWindows() and not isMac():
Expand Down
62 changes: 31 additions & 31 deletions python/plugins/processing/gui/menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
15 changes: 7 additions & 8 deletions python/plugins/processing/tools/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)


Expand Down

0 comments on commit 378212c

Please sign in to comment.