From f996c54776ca0e16f69f56ff7093cef2eed2aa58 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Fri, 30 Oct 2015 23:30:16 +0100 Subject: [PATCH] indentation update --- .../GdalTools/tools/GdalTools_utils.py | 2 ++ python/plugins/GdalTools/tools/doClipper.py | 3 +- .../processing/algs/gdal/ClipByExtent.py | 28 ++++++++-------- .../processing/algs/gdal/ClipByMask.py | 32 +++++++++---------- python/plugins/processing/algs/gdal/ogrsql.py | 1 + .../plugins/processing/algs/gdal/rasterize.py | 4 +-- .../plugins/processing/algs/gdal/translate.py | 24 +++++++------- python/plugins/processing/algs/gdal/warp.py | 24 +++++++------- .../processing/algs/saga/SagaAlgorithm212.py | 2 +- .../processing/core/ProcessingConfig.py | 1 + python/plugins/processing/core/outputs.py | 2 +- python/plugins/processing/gui/ConfigDialog.py | 1 - python/plugins/processing/tools/vector.py | 6 ++-- src/app/qgswelcomepageitemsmodel.cpp | 2 +- src/core/qgsexpression.cpp | 2 +- src/server/qgswmsconfigparser.cpp | 2 +- 16 files changed, 70 insertions(+), 66 deletions(-) diff --git a/python/plugins/GdalTools/tools/GdalTools_utils.py b/python/plugins/GdalTools/tools/GdalTools_utils.py index 239bccbf529..9eded70b465 100644 --- a/python/plugins/GdalTools/tools/GdalTools_utils.py +++ b/python/plugins/GdalTools/tools/GdalTools_utils.py @@ -387,6 +387,8 @@ def getRasterResolution(fileName): # 3. bypass the following bug: # when you use the 'filter' argument, the dialog is enlarged up to the longest filter length, # so sometimes the dialog excedes the screen width + + class FileDialog: @classmethod diff --git a/python/plugins/GdalTools/tools/doClipper.py b/python/plugins/GdalTools/tools/doClipper.py index 9dcf8b55b62..67d90e586d0 100644 --- a/python/plugins/GdalTools/tools/doClipper.py +++ b/python/plugins/GdalTools/tools/doClipper.py @@ -31,6 +31,7 @@ from ui_widgetClipper import Ui_GdalToolsWidget as Ui_Widget from widgetPluginBase import GdalToolsBasePluginWidget as BasePluginWidget import GdalTools_utils as Utils + class GdalToolsDialog(QWidget, Ui_Widget, BasePluginWidget): def __init__(self, iface): @@ -94,7 +95,7 @@ class GdalToolsDialog(QWidget, Ui_Widget, BasePluginWidget): self.resolutionWidget.hide() else: self.resolutionWidget.show() - + def checkRun(self): if self.extentModeRadio.isChecked(): enabler = self.extentSelector.isCoordsValid() diff --git a/python/plugins/processing/algs/gdal/ClipByExtent.py b/python/plugins/processing/algs/gdal/ClipByExtent.py index 99ad5c9adf2..fcabbd9c93c 100644 --- a/python/plugins/processing/algs/gdal/ClipByExtent.py +++ b/python/plugins/processing/algs/gdal/ClipByExtent.py @@ -56,7 +56,7 @@ class ClipByExtent(GdalAlgorithm): BIGTIFFTYPE = ['', 'YES', 'NO', 'IF_NEEDED', 'IF_SAFER'] COMPRESSTYPE = ['NONE', 'JPEG', 'LZW', 'PACKBITS', 'DEFLATE'] TFW = 'TFW' - + def defineCharacteristics(self): self.name, self.i18n_name = self.trAlgorithm('Clip raster by extent') self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction') @@ -69,26 +69,26 @@ class ClipByExtent(GdalAlgorithm): params = [] params.append(ParameterSelection(self.RTYPE, - self.tr('Output raster type'), self.TYPE, 5)) + self.tr('Output raster type'), self.TYPE, 5)) params.append(ParameterSelection(self.COMPRESS, - self.tr('GeoTIFF options. Compression type:'), self.COMPRESSTYPE, 4)) + self.tr('GeoTIFF options. Compression type:'), self.COMPRESSTYPE, 4)) params.append(ParameterNumber(self.JPEGCOMPRESSION, - self.tr('Set the JPEG compression level'), - 1, 100, 75)) + self.tr('Set the JPEG compression level'), + 1, 100, 75)) params.append(ParameterNumber(self.ZLEVEL, - self.tr('Set the DEFLATE compression level'), - 1, 9, 6)) + self.tr('Set the DEFLATE compression level'), + 1, 9, 6)) params.append(ParameterNumber(self.PREDICTOR, - self.tr('Set the predictor for LZW or DEFLATE compression'), - 1, 3, 1)) + self.tr('Set the predictor for LZW or DEFLATE compression'), + 1, 3, 1)) params.append(ParameterBoolean(self.TILED, - self.tr('Create tiled output (only used for the GTiff format)'), False)) + self.tr('Create tiled output (only used for the GTiff format)'), False)) params.append(ParameterSelection(self.BIGTIFF, - self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0)) + self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0)) params.append(ParameterBoolean(self.TFW, - self.tr('Force the generation of an associated ESRI world file (.tfw))'), False)) + self.tr('Force the generation of an associated ESRI world file (.tfw))'), False)) params.append(ParameterString(self.EXTRA, - self.tr('Additional creation parameters'), '', optional=True)) + self.tr('Additional creation parameters'), '', optional=True)) for param in params: param.isAdvanced = True @@ -113,7 +113,7 @@ class ClipByExtent(GdalAlgorithm): arguments.append('-of') arguments.append(GdalUtils.getFormatShortNameFromFilename(out)) arguments.append('-ot') - arguments.append(self.TYPE[self.getParameterValue(self.RTYPE)]) + arguments.append(self.TYPE[self.getParameterValue(self.RTYPE)]) if len(noData) > 0: arguments.append('-a_nodata') arguments.append(noData) diff --git a/python/plugins/processing/algs/gdal/ClipByMask.py b/python/plugins/processing/algs/gdal/ClipByMask.py index 1dc24a6242f..9c7ff0e32dc 100644 --- a/python/plugins/processing/algs/gdal/ClipByMask.py +++ b/python/plugins/processing/algs/gdal/ClipByMask.py @@ -42,7 +42,7 @@ from processing.algs.gdal.OgrAlgorithm import OgrAlgorithm from processing.algs.gdal.GdalUtils import GdalUtils -class ClipByMask(GdalAlgorithm,OgrAlgorithm): +class ClipByMask(GdalAlgorithm, OgrAlgorithm): INPUT = 'INPUT' OUTPUT = 'OUTPUT' @@ -63,7 +63,7 @@ class ClipByMask(GdalAlgorithm,OgrAlgorithm): BIGTIFFTYPE = ['', 'YES', 'NO', 'IF_NEEDED', 'IF_SAFER'] COMPRESSTYPE = ['NONE', 'JPEG', 'LZW', 'PACKBITS', 'DEFLATE'] TFW = 'TFW' - + def defineCharacteristics(self): self.name, self.i18n_name = self.trAlgorithm('Clip raster by mask layer') self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction') @@ -82,30 +82,30 @@ class ClipByMask(GdalAlgorithm,OgrAlgorithm): params = [] params.append(ParameterSelection(self.RTYPE, - self.tr('Output raster type'), self.TYPE, 5)) + self.tr('Output raster type'), self.TYPE, 5)) params.append(ParameterSelection(self.COMPRESS, - self.tr('GeoTIFF options. Compression type:'), self.COMPRESSTYPE, 4)) + self.tr('GeoTIFF options. Compression type:'), self.COMPRESSTYPE, 4)) params.append(ParameterNumber(self.JPEGCOMPRESSION, - self.tr('Set the JPEG compression level'), - 1, 100, 75)) + self.tr('Set the JPEG compression level'), + 1, 100, 75)) params.append(ParameterNumber(self.ZLEVEL, - self.tr('Set the DEFLATE compression level'), - 1, 9, 6)) + self.tr('Set the DEFLATE compression level'), + 1, 9, 6)) params.append(ParameterNumber(self.PREDICTOR, - self.tr('Set the predictor for LZW or DEFLATE compression'), - 1, 3, 1)) + self.tr('Set the predictor for LZW or DEFLATE compression'), + 1, 3, 1)) params.append(ParameterBoolean(self.TILED, - self.tr('Create tiled output (only used for the GTiff format)'), False)) + self.tr('Create tiled output (only used for the GTiff format)'), False)) params.append(ParameterSelection(self.BIGTIFF, - self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0)) + self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0)) params.append(ParameterBoolean(self.TFW, - self.tr('Force the generation of an associated ESRI world file (.tfw))'), False)) + self.tr('Force the generation of an associated ESRI world file (.tfw))'), False)) params.append(ParameterString(self.EXTRA, - self.tr('Additional creation parameters'), '', optional=True)) + self.tr('Additional creation parameters'), '', optional=True)) for param in params: param.isAdvanced = True - self.addParameter(param) + self.addParameter(param) self.addOutput(OutputRaster(self.OUTPUT, self.tr('Clipped (mask)'))) @@ -153,7 +153,7 @@ class ClipByMask(GdalAlgorithm,OgrAlgorithm): if addAlphaBand: arguments.append('-dstalpha') - + if len(extra) > 0: arguments.append(extra) if GdalUtils.getFormatShortNameFromFilename(out) == "GTiff": diff --git a/python/plugins/processing/algs/gdal/ogrsql.py b/python/plugins/processing/algs/gdal/ogrsql.py index da1cdcd570f..7383ca7ace1 100644 --- a/python/plugins/processing/algs/gdal/ogrsql.py +++ b/python/plugins/processing/algs/gdal/ogrsql.py @@ -37,6 +37,7 @@ from processing.algs.gdal.OgrAlgorithm import OgrAlgorithm DIALECTS = [None, 'ogrsql', 'sqlite'] + class OgrSql(OgrAlgorithm): INPUT = 'INPUT' diff --git a/python/plugins/processing/algs/gdal/rasterize.py b/python/plugins/processing/algs/gdal/rasterize.py index 238584efc2b..3b447a36cf3 100644 --- a/python/plugins/processing/algs/gdal/rasterize.py +++ b/python/plugins/processing/algs/gdal/rasterize.py @@ -101,7 +101,7 @@ class rasterize(OgrAlgorithm): self.addParameter(ParameterBoolean(self.TFW, self.tr('Force the generation of an associated ESRI world file (.tfw)'), False)) params.append(ParameterString(self.EXTRA, - self.tr('Additional creation parameters'), '', optional=True)) + self.tr('Additional creation parameters'), '', optional=True)) for param in params: param.isAdvanced = True @@ -122,7 +122,7 @@ class rasterize(OgrAlgorithm): bigtiff = self.BIGTIFFTYPE[self.getParameterValue(self.BIGTIFF)] tfw = unicode(self.getParameterValue(self.TFW)) out = self.getOutputValue(self.OUTPUT) - extra = unicode(self.getParameterValue(self.EXTRA)) + extra = unicode(self.getParameterValue(self.EXTRA)) arguments = [] arguments.append('-a') diff --git a/python/plugins/processing/algs/gdal/translate.py b/python/plugins/processing/algs/gdal/translate.py index 592f756028d..e5bf9b337e2 100644 --- a/python/plugins/processing/algs/gdal/translate.py +++ b/python/plugins/processing/algs/gdal/translate.py @@ -90,26 +90,26 @@ class translate(GdalAlgorithm): params = [] params.append(ParameterSelection(self.RTYPE, - self.tr('Output raster type'), self.TYPE, 5)) + self.tr('Output raster type'), self.TYPE, 5)) params.append(ParameterSelection(self.COMPRESS, - self.tr('GeoTIFF options. Compression type:'), self.COMPRESSTYPE, 4)) + self.tr('GeoTIFF options. Compression type:'), self.COMPRESSTYPE, 4)) params.append(ParameterNumber(self.JPEGCOMPRESSION, - self.tr('Set the JPEG compression level'), - 1, 100, 75)) + self.tr('Set the JPEG compression level'), + 1, 100, 75)) params.append(ParameterNumber(self.ZLEVEL, - self.tr('Set the DEFLATE compression level'), - 1, 9, 6)) + self.tr('Set the DEFLATE compression level'), + 1, 9, 6)) params.append(ParameterNumber(self.PREDICTOR, - self.tr('Set the predictor for LZW or DEFLATE compression'), - 1, 3, 1)) + self.tr('Set the predictor for LZW or DEFLATE compression'), + 1, 3, 1)) params.append(ParameterBoolean(self.TILED, - self.tr('Create tiled output (only used for the GTiff format)'), False)) + self.tr('Create tiled output (only used for the GTiff format)'), False)) params.append(ParameterSelection(self.BIGTIFF, - self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0)) + self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0)) params.append(ParameterBoolean(self.TFW, - self.tr('Force the generation of an associated ESRI world file (.tfw))'), False)) + self.tr('Force the generation of an associated ESRI world file (.tfw))'), False)) params.append(ParameterString(self.EXTRA, - self.tr('Additional creation parameters'), '', optional=True)) + self.tr('Additional creation parameters'), '', optional=True)) for param in params: param.isAdvanced = True diff --git a/python/plugins/processing/algs/gdal/warp.py b/python/plugins/processing/algs/gdal/warp.py index af09979ccb2..1140c8361d8 100644 --- a/python/plugins/processing/algs/gdal/warp.py +++ b/python/plugins/processing/algs/gdal/warp.py @@ -78,26 +78,26 @@ class warp(GdalAlgorithm): params = [] params.append(ParameterSelection(self.RTYPE, - self.tr('Output raster type'), self.TYPE, 5)) + self.tr('Output raster type'), self.TYPE, 5)) params.append(ParameterSelection(self.COMPRESS, - self.tr('GeoTIFF options. Compression type:'), self.COMPRESSTYPE, 4)) + self.tr('GeoTIFF options. Compression type:'), self.COMPRESSTYPE, 4)) params.append(ParameterNumber(self.JPEGCOMPRESSION, - self.tr('Set the JPEG compression level'), - 1, 100, 75)) + self.tr('Set the JPEG compression level'), + 1, 100, 75)) params.append(ParameterNumber(self.ZLEVEL, - self.tr('Set the DEFLATE compression level'), - 1, 9, 6)) + self.tr('Set the DEFLATE compression level'), + 1, 9, 6)) params.append(ParameterNumber(self.PREDICTOR, - self.tr('Set the predictor for LZW or DEFLATE compression'), - 1, 3, 1)) + self.tr('Set the predictor for LZW or DEFLATE compression'), + 1, 3, 1)) params.append(ParameterBoolean(self.TILED, - self.tr('Create tiled output (only used for the GTiff format)'), False)) + self.tr('Create tiled output (only used for the GTiff format)'), False)) params.append(ParameterSelection(self.BIGTIFF, - self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0)) + self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0)) params.append(ParameterBoolean(self.TFW, - self.tr('Force the generation of an associated ESRI world file (.tfw))'), False)) + self.tr('Force the generation of an associated ESRI world file (.tfw))'), False)) params.append(ParameterString(self.EXTRA, - self.tr('Additional creation parameters'), '', optional=True)) + self.tr('Additional creation parameters'), '', optional=True)) for param in params: param.isAdvanced = True diff --git a/python/plugins/processing/algs/saga/SagaAlgorithm212.py b/python/plugins/processing/algs/saga/SagaAlgorithm212.py index 4d833ebc9a2..be0d20f18f7 100644 --- a/python/plugins/processing/algs/saga/SagaAlgorithm212.py +++ b/python/plugins/processing/algs/saga/SagaAlgorithm212.py @@ -195,7 +195,7 @@ class SagaAlgorithm212(GeoAlgorithm): f.write('\t'.join([col for col in param.cols]) + '\n') values = param.value.split(',') for i in range(0, len(values), 3): - s = values[i] + '\t' + values[i + 1] + '\t' + values[i+ 2] + '\n' + s = values[i] + '\t' + values[i + 1] + '\t' + values[i + 2] + '\n' f.write(s) f.close() command += ' -' + param.name + ' "' + tempTableFile + '"' diff --git a/python/plugins/processing/core/ProcessingConfig.py b/python/plugins/processing/core/ProcessingConfig.py index 68d35c34cd8..aefec2f99e6 100644 --- a/python/plugins/processing/core/ProcessingConfig.py +++ b/python/plugins/processing/core/ProcessingConfig.py @@ -32,6 +32,7 @@ from PyQt4.QtGui import QIcon from processing.tools.system import tempFolder import processing.tools.dataobjects + class ProcessingConfig: OUTPUT_FOLDER = 'OUTPUT_FOLDER' diff --git a/python/plugins/processing/core/outputs.py b/python/plugins/processing/core/outputs.py index b964d9adf6a..28948bda01a 100644 --- a/python/plugins/processing/core/outputs.py +++ b/python/plugins/processing/core/outputs.py @@ -31,6 +31,7 @@ from processing.tools.vector import VectorWriter, TableWriter from processing.tools import dataobjects from processing.core.ProcessingConfig import ProcessingConfig + def getOutputFromString(s): tokens = s.split("|") params = [t if unicode(t) != "None" else None for t in tokens[1:]] @@ -152,7 +153,6 @@ class OutputRaster(Output): compatible = None - def getFileFilter(self, alg): exts = dataobjects.getSupportedOutputRasterLayerExtensions() for i in range(len(exts)): diff --git a/python/plugins/processing/gui/ConfigDialog.py b/python/plugins/processing/gui/ConfigDialog.py index 4a50d3c403c..4cdd0a3c15a 100644 --- a/python/plugins/processing/gui/ConfigDialog.py +++ b/python/plugins/processing/gui/ConfigDialog.py @@ -213,7 +213,6 @@ class SettingDelegate(QStyledItemDelegate): elif isinstance(value, (str, unicode)): return QLineEdit(parent) - def setEditorData(self, editor, index): value = self.convertValue(index.model().data(index, Qt.EditRole)) setting = index.model().data(index, Qt.UserRole) diff --git a/python/plugins/processing/tools/vector.py b/python/plugins/processing/tools/vector.py index eb11d6945c7..b9db0d5b08b 100644 --- a/python/plugins/processing/tools/vector.py +++ b/python/plugins/processing/tools/vector.py @@ -389,9 +389,9 @@ def snapToPrecision(geom, precision): i = 0 p = snapped.vertexAt(i) while p.x() != 0.0 and p.y() != 0.0: - x = round(p.x() / precision,0) * precision - y = round(p.y() / precision,0) * precision - snapped.moveVertex(x,y,i) + x = round(p.x() / precision, 0) * precision + y = round(p.y() / precision, 0) * precision + snapped.moveVertex(x, y, i) i = i + 1 p = snapped.vertexAt(i) return snapped diff --git a/src/app/qgswelcomepageitemsmodel.cpp b/src/app/qgswelcomepageitemsmodel.cpp index 5a4b9756e1b..67173051577 100644 --- a/src/app/qgswelcomepageitemsmodel.cpp +++ b/src/app/qgswelcomepageitemsmodel.cpp @@ -114,7 +114,7 @@ QSize QgsWelcomePageItemDelegate::sizeHint( const QStyleOptionViewItem & option, index.data( QgsWelcomePageItemsModel::CrsRole ).toString() ) ); doc.setTextWidth( width - ( !icon.isNull() ? icon.width() + 35 : 35 ) ); - return QSize( width, qMax( ( double ) doc.size().height() + 10, ( double )icon.height() ) + 20 ); + return QSize( width, qMax(( double ) doc.size().height() + 10, ( double )icon.height() ) + 20 ); } QgsWelcomePageItemsModel::QgsWelcomePageItemsModel( QObject* parent ) diff --git a/src/core/qgsexpression.cpp b/src/core/qgsexpression.cpp index 956b0f50352..4315f6b3eab 100644 --- a/src/core/qgsexpression.cpp +++ b/src/core/qgsexpression.cpp @@ -1487,7 +1487,7 @@ static QVariant fcnRelate( const QVariantList& values, const QgsExpressionContex QString result = engine->relate( *sGeom.geometry() ); delete engine; - return QVariant::fromValue( result ); + return QVariant::fromValue( result ); } static QVariant fcnBbox( const QVariantList& values, const QgsExpressionContext*, QgsExpression* parent ) diff --git a/src/server/qgswmsconfigparser.cpp b/src/server/qgswmsconfigparser.cpp index 3a214c45ddc..70e33db5489 100644 --- a/src/server/qgswmsconfigparser.cpp +++ b/src/server/qgswmsconfigparser.cpp @@ -148,7 +148,7 @@ QgsComposition* QgsWMSConfigParser::createPrintComposition( const QString& compo { styleName = wmsStyleList.at( i ); } - + bool allowCaching = true; if ( wmsLayerList.count( wmsLayer ) > 1 ) {