Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Dec 2, 2015
1 parent 2dfa10f commit 02f8988837339467b252840b810295cd279463af
@@ -42,8 +42,8 @@ def __init__(self, iface):
self.setupUi(self)
BasePluginWidget.__init__(self, self.iface, "gdalbuildvrt")

self.inSelector.setType( self.inSelector.FILE )
self.outSelector.setType( self.outSelector.FILE )
self.inSelector.setType(self.inSelector.FILE)
self.outSelector.setType(self.outSelector.FILE)
self.recurseCheck.hide()
self.visibleRasterLayers = []

@@ -64,12 +64,11 @@ def __init__(self, iface):

self.connect(self.inSelector, SIGNAL("selectClicked()"), self.fillInputFilesEdit)
self.connect(self.outSelector, SIGNAL("selectClicked()"), self.fillOutputFileEdit)
self.connect( self.inputDirCheck, SIGNAL( "stateChanged( int )" ), self.switchToolMode )
self.connect( self.inputSelLayersCheck, SIGNAL( "stateChanged( int )" ), self.switchLayerMode )
self.connect( self.iface.mapCanvas(), SIGNAL( "stateChanged( int )" ), self.switchLayerMode )
self.connect(self.inputDirCheck, SIGNAL("stateChanged( int )"), self.switchToolMode)
self.connect(self.inputSelLayersCheck, SIGNAL("stateChanged( int )"), self.switchLayerMode)
self.connect(self.iface.mapCanvas(), SIGNAL("stateChanged( int )"), self.switchLayerMode)
self.connect(self.selectTargetSRSButton, SIGNAL("clicked()"), self.fillTargetSRSEdit)


def initialize(self):
# connect to mapCanvas.layerChanged() signal
self.connect(self.iface.mapCanvas(), SIGNAL("layersChanged()"), self.onVisibleLayersChanged)
@@ -81,61 +80,60 @@ def onClosing(self):
self.disconnect(self.iface.mapCanvas(), SIGNAL("layersChanged()"), self.onVisibleLayersChanged)
BasePluginWidget.onClosing(self)


def onVisibleLayersChanged(self):
# refresh list of visible raster layers
self.visibleRasterLayers = []
for layer in self.iface.mapCanvas().layers():
if Utils.LayerRegistry.isRaster( layer ):
self.visibleRasterLayers.append( layer.source() )
if Utils.LayerRegistry.isRaster(layer):
self.visibleRasterLayers.append(layer.source())

# refresh the text in the command viewer
self.someValueChanged()

def switchToolMode(self):
self.recurseCheck.setVisible( self.inputDirCheck.isChecked() )
self.recurseCheck.setVisible(self.inputDirCheck.isChecked())
self.inSelector.clear()

if self.inputDirCheck.isChecked():
self.inFileLabel = self.label.text()
self.label.setText( QCoreApplication.translate( "GdalTools", "&Input directory" ) )
self.label.setText(QCoreApplication.translate("GdalTools", "&Input directory"))

QObject.disconnect(self.inSelector, SIGNAL("selectClicked()"), self.fillInputFilesEdit)
QObject.connect(self.inSelector, SIGNAL("selectClicked()"), self.fillInputDir)
else:
self.label.setText( self.inFileLabel )
self.label.setText(self.inFileLabel)

QObject.connect(self.inSelector, SIGNAL("selectClicked()"), self.fillInputFilesEdit)
QObject.disconnect(self.inSelector, SIGNAL("selectClicked()"), self.fillInputDir)

def switchLayerMode(self):
enableInputFiles = not self.inputSelLayersCheck.isChecked()
self.inputDirCheck.setEnabled( enableInputFiles )
self.inSelector.setEnabled( enableInputFiles )
self.recurseCheck.setEnabled( enableInputFiles )
self.inputDirCheck.setEnabled(enableInputFiles)
self.inSelector.setEnabled(enableInputFiles)
self.recurseCheck.setEnabled(enableInputFiles)

def fillInputFilesEdit(self):
lastUsedFilter = Utils.FileFilter.lastUsedRasterFilter()
files = Utils.FileDialog.getOpenFileNames(self, self.tr( "Select the files for VRT" ), Utils.FileFilter.allRastersFilter(), lastUsedFilter)
files = Utils.FileDialog.getOpenFileNames(self, self.tr("Select the files for VRT"), Utils.FileFilter.allRastersFilter(), lastUsedFilter)
if files == '':
return
Utils.FileFilter.setLastUsedRasterFilter(lastUsedFilter)
self.inSelector.setFilename(",".join(files))

def fillOutputFileEdit(self):
outputFile = Utils.FileDialog.getSaveFileName(self, self.tr( "Select where to save the VRT" ), self.tr( "VRT (*.vrt)" ))
outputFile = Utils.FileDialog.getSaveFileName(self, self.tr("Select where to save the VRT"), self.tr("VRT (*.vrt)"))
if outputFile == '':
return
self.outSelector.setFilename(outputFile)

def fillInputDir( self ):
inputDir = Utils.FileDialog.getExistingDirectory( self, self.tr( "Select the input directory with files for VRT" ))
def fillInputDir(self):
inputDir = Utils.FileDialog.getExistingDirectory(self, self.tr("Select the input directory with files for VRT"))
if inputDir == '':
return
self.inSelector.setFilename( inputDir )
self.inSelector.setFilename(inputDir)

def fillTargetSRSEdit(self):
dialog = SRSDialog( "Select the target SRS", self )
dialog = SRSDialog("Select the target SRS", self)
if dialog.exec_():
self.targetSRSEdit.setText(dialog.getProjection())

@@ -158,7 +156,7 @@ def getArguments(self):
if self.inputSelLayersCheck.isChecked():
arguments.extend(self.visibleRasterLayers)
elif self.inputDirCheck.isChecked():
arguments.extend(Utils.getRasterFiles( self.getInputFileName(), self.recurseCheck.isChecked() ))
arguments.extend(Utils.getRasterFiles(self.getInputFileName(), self.recurseCheck.isChecked()))
else:
arguments.extend(self.getInputFileName())
return arguments
@@ -181,9 +181,9 @@ def runFinishedFromThread(self, output):
self.tblUnique.setColumnCount(2)
for rec in range(numRows):
if ":" not in result[rec]:
tmp = result[rec].split(u"\uff1a")
tmp = result[rec].split(u"\uff1a")
else:
tmp = result[rec].split(":")
tmp = result[rec].split(":")
item = QTableWidgetItem(tmp[0])
self.tblUnique.setItem(rec, 0, item)
item = QTableWidgetItem(tmp[1])
@@ -118,7 +118,7 @@ def processAlgorithm(self, progress):

srcOffset = (startColumn, startRow, width, height)
srcArray = rasterBand.ReadAsArray(*srcOffset)
srcArray = srcArray*rasterBand.GetScale()+rasterBand.GetOffset()
srcArray = srcArray * rasterBand.GetScale() + rasterBand.GetOffset()

newGeoTransform = (
geoTransform[0] + srcOffset[0] * geoTransform[1],
@@ -193,7 +193,7 @@ def processAlgorithm(self, progress):

srcOffset = (startColumn, startRow, width, height)
srcArray = rasterBand.ReadAsArray(*srcOffset)
srcArray = srcArray*rasterBand.GetScale()+rasterBand.GetOffset()
srcArray = srcArray * rasterBand.GetScale() + rasterBand.GetOffset()

newGeoTransform = (
geoTransform[0] + srcOffset[0] * geoTransform[1],
@@ -153,8 +153,8 @@ QgsAbstractFeatureSource* QgsWFSProvider::featureSource() const

void QgsWFSProvider::reloadData()
{
if (mCached)
deleteData();
if ( mCached )
deleteData();
delete mSpatialIndex;
mSpatialIndex = new QgsSpatialIndex();
mValid = !getFeature( dataSourceUri() );
@@ -286,8 +286,8 @@ QgsFeatureIterator QgsWFSProvider::getFeatures( const QgsFeatureRequest& request
QgsRectangle rect = request.filterRect();
if ( !( request.flags() & QgsFeatureRequest::NoGeometry ) && !rect.isEmpty() )
{
deleteData();
reloadData();
deleteData();
reloadData();
}
return new QgsWFSFeatureIterator( new QgsWFSFeatureSource( this ), true, request );
#endif
@@ -1724,7 +1724,7 @@ void QgsWFSProvider::extendExtent( const QgsRectangle &extent )

QgsRectangle r( mExtent.intersect( &extent ) );

if ( (extent == mGetExtent || mFeatureCount == 0 || mFeatureCount % 500 != 0)
if (( extent == mGetExtent || mFeatureCount == 0 || mFeatureCount % 500 != 0 )
&& mGetExtent.contains( r ) )
return;

@@ -491,7 +491,7 @@ void QgsServerProjectParser::serviceCapabilities( QDomElement& parentElement, QD
QDomText contactOrganizationText = doc.createTextNode( contactOrganizationString );
wmsContactOrganizationElem.appendChild( contactOrganizationText );
contactPersonPrimaryElem.appendChild( wmsContactOrganizationElem );

//Contact position
QDomElement contactPositionElem = propertiesElement.firstChildElement( "WMSContactPosition" );
QString contactPositionString;

0 comments on commit 02f8988

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