Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Oct 30, 2015
1 parent 3a93ca6 commit f996c54776ca0e16f69f56ff7093cef2eed2aa58
@@ -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
@@ -31,6 +31,7 @@
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 @@ def switchResolutionMode(self):
self.resolutionWidget.hide()
else:
self.resolutionWidget.show()

def checkRun(self):
if self.extentModeRadio.isChecked():
enabler = self.extentSelector.isCoordsValid()
@@ -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 @@ def defineCharacteristics(self):

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 @@ def getConsoleCommands(self):
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)
@@ -42,7 +42,7 @@
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 @@ def defineCharacteristics(self):

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 @@ def getConsoleCommands(self):

if addAlphaBand:
arguments.append('-dstalpha')

if len(extra) > 0:
arguments.append(extra)
if GdalUtils.getFormatShortNameFromFilename(out) == "GTiff":
@@ -37,6 +37,7 @@

DIALECTS = [None, 'ogrsql', 'sqlite']


class OgrSql(OgrAlgorithm):

INPUT = 'INPUT'
@@ -101,7 +101,7 @@ def defineCharacteristics(self):
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 @@ def getConsoleCommands(self):
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')
@@ -90,26 +90,26 @@ def defineCharacteristics(self):

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
@@ -78,26 +78,26 @@ def defineCharacteristics(self):

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
@@ -195,7 +195,7 @@ def processAlgorithm(self, progress):
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 + '"'
@@ -32,6 +32,7 @@
from processing.tools.system import tempFolder
import processing.tools.dataobjects


class ProcessingConfig:

OUTPUT_FOLDER = 'OUTPUT_FOLDER'
@@ -31,6 +31,7 @@
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)):
@@ -213,7 +213,6 @@ def createEditor(
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)
@@ -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
@@ -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 )
@@ -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 )
@@ -148,7 +148,7 @@ QgsComposition* QgsWMSConfigParser::createPrintComposition( const QString& compo
{
styleName = wmsStyleList.at( i );
}

bool allowCaching = true;
if ( wmsLayerList.count( wmsLayer ) > 1 )
{

0 comments on commit f996c54

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