indentation update

This commit is contained in:
Juergen E. Fischer 2015-10-30 23:30:16 +01:00
parent 3a93ca62a9
commit f996c54776
16 changed files with 70 additions and 66 deletions

View File

@ -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

View File

@ -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):

View File

@ -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

View File

@ -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'
@ -82,26 +82,26 @@ 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

View File

@ -37,6 +37,7 @@ from processing.algs.gdal.OgrAlgorithm import OgrAlgorithm
DIALECTS = [None, 'ogrsql', 'sqlite']
class OgrSql(OgrAlgorithm):
INPUT = 'INPUT'

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 + '"'

View File

@ -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'

View File

@ -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)):

View File

@ -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)

View File

@ -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

View File

@ -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 )

View File

@ -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 )