Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 30, 2015
1 parent 3a93ca6 commit f996c54
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 66 deletions.
2 changes: 2 additions & 0 deletions python/plugins/GdalTools/tools/GdalTools_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/GdalTools/tools/doClipper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand Down
28 changes: 14 additions & 14 deletions python/plugins/processing/algs/gdal/ClipByExtent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
Expand All @@ -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)
Expand Down
32 changes: 16 additions & 16 deletions python/plugins/processing/algs/gdal/ClipByMask.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from processing.algs.gdal.GdalUtils import GdalUtils


class ClipByMask(GdalAlgorithm,OgrAlgorithm):
class ClipByMask(GdalAlgorithm, OgrAlgorithm):

INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
Expand All @@ -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')
Expand All @@ -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)')))

Expand Down Expand Up @@ -153,7 +153,7 @@ def getConsoleCommands(self):

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

if len(extra) > 0:
arguments.append(extra)
if GdalUtils.getFormatShortNameFromFilename(out) == "GTiff":
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/ogrsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

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


class OgrSql(OgrAlgorithm):

INPUT = 'INPUT'
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/gdal/rasterize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand Down
24 changes: 12 additions & 12 deletions python/plugins/processing/algs/gdal/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 12 additions & 12 deletions python/plugins/processing/algs/gdal/warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/saga/SagaAlgorithm212.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '"'
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/core/ProcessingConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from processing.tools.system import tempFolder
import processing.tools.dataobjects


class ProcessingConfig:

OUTPUT_FOLDER = 'OUTPUT_FOLDER'
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/core/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:]]
Expand Down Expand Up @@ -152,7 +153,6 @@ class OutputRaster(Output):

compatible = None


def getFileFilter(self, alg):
exts = dataobjects.getSupportedOutputRasterLayerExtensions()
for i in range(len(exts)):
Expand Down
1 change: 0 additions & 1 deletion python/plugins/processing/gui/ConfigDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/tools/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgswelcomepageitemsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgswmsconfigparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ QgsComposition* QgsWMSConfigParser::createPrintComposition( const QString& compo
{
styleName = wmsStyleList.at( i );
}

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

0 comments on commit f996c54

Please sign in to comment.