Skip to content

Commit

Permalink
indentation update (note to self: always run scripts/prepare-commit.s…
Browse files Browse the repository at this point in the history
…h before committing)
  • Loading branch information
jef-n committed Sep 17, 2013
1 parent 58d0483 commit 51297d5
Show file tree
Hide file tree
Showing 56 changed files with 450 additions and 436 deletions.
16 changes: 8 additions & 8 deletions python/core/composer/qgscomposermap.sip
Expand Up @@ -208,11 +208,11 @@ class QgsComposerMap : QgsComposerItem
@note this function was added in version 1.4*/
void setGridAnnotationFont( const QFont& f );
QFont gridAnnotationFont() const;

/**Sets font color for grid annotations
@note this function was added in version 2.0*/
void setAnnotationFontColor( const QColor& c );
QColor annotationFontColor() const;
QColor annotationFontColor() const;

/**Sets coordinate precision for grid annotations
@note this function was added in version 1.4*/
Expand Down Expand Up @@ -247,13 +247,13 @@ class QgsComposerMap : QgsComposerItem
@note: this function was added in version 1.9*/
void setGridFrameWidth( double w );
double gridFrameWidth() const;

/** Returns the grid's blending mode
@note added in version 2.0*/
const QPainter::CompositionMode gridBlendMode() const;
/** Sets the grid's blending mode
@note added in version 2.0*/
void setGridBlendMode( const QPainter::CompositionMode blendMode );
@note added in version 2.0*/
void setGridBlendMode( const QPainter::CompositionMode blendMode );

/**In case of annotations, the bounding rectangle can be larger than the map item rectangle
@note this function was added in version 1.4*/
Expand Down Expand Up @@ -293,10 +293,10 @@ class QgsComposerMap : QgsComposerItem
/* Returns the blending mode for the overview frame
@note added in version 1.9*/
const QPainter::CompositionMode overviewBlendMode() const;
/* Sets the blending mode for the overview frame
@note added in version 1.9*/
/* Sets the blending mode for the overview frame
@note added in version 1.9*/
void setOverviewBlendMode( const QPainter::CompositionMode blendMode );

/**Sets flag if overview frame should be inverted
@note this function was added in version 1.9*/
void setOverviewInverted( bool inverted );
Expand Down
9 changes: 4 additions & 5 deletions python/core/composer/qgscomposershape.sip
Expand Up @@ -42,17 +42,16 @@ class QgsComposerShape: QgsComposerItem
/**Sets this items bound in scene coordinates such that 1 item size units
corresponds to 1 scene size unit. Also, the shape is scaled*/
void setSceneRect( const QRectF& rectangle );
/**Sets radius for rounded rectangle corners*/

/**Sets radius for rounded rectangle corners. Added in v2.1 */
void setCornerRadius( double radius );
/**Returns the radius for rounded rectangle corners*/
double cornerRadius() const;
/**Returns the radius for rounded rectangle corners*/
double cornerRadius() const;

public slots:
/**Sets item rotation and resizes item bounds such that the shape always has the same size*/
virtual void setRotation( double r );


protected:
/* reimplement drawFrame, since it's not a rect, but a custom shape */
virtual void drawFrame( QPainter* p );
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsattributeaction.sip
Expand Up @@ -53,7 +53,7 @@ class QgsAttributeAction

//! Remove an action at given index
void removeAction( int index );

/*! Does the given values. defaultValueIndex is the index of the
* field to be used if the action has a $currfield placeholder.
* @note added in 1.9
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsgmlschema.sip
Expand Up @@ -18,7 +18,7 @@ class QgsGmlFeatureClass
QStringList & geometryAttributes();
};

class QgsGmlSchema: QObject
class QgsGmlSchema: QObject
{

%TypeHeaderCode
Expand Down
2 changes: 1 addition & 1 deletion python/core/raster/qgsrasterdataprovider.sip
Expand Up @@ -95,7 +95,7 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
const QString & theResamplingMethod = "NEAREST",
QgsRaster::RasterPyramidsFormat theFormat = QgsRaster::PyramidsGTiff,
const QStringList & theConfigOptions = QStringList() );

/** \brief Accessor for ths raster layers pyramid list.
* @param overviewList used to construct the pyramid list (optional), when empty the list is defined by the provider.
* A pyramid list defines the
Expand Down
10 changes: 5 additions & 5 deletions python/core/raster/qgsrasterrange.sip
Expand Up @@ -8,17 +8,17 @@ class QgsRasterRange

public:
QgsRasterRange();

QgsRasterRange( double theMin, double theMax );

~QgsRasterRange();

double min() const;
double max() const;

double setMin( double theMin );
double setMax( double theMax );

bool operator==( const QgsRasterRange &o ) const;

bool contains( double value, const QgsRasterRangeList &rangeList );
Expand Down
6 changes: 3 additions & 3 deletions python/core/raster/qgsrasterviewport.sip
Expand Up @@ -4,16 +4,16 @@ struct QgsRasterViewPort
%TypeHeaderCode
#include <qgsrasterviewport.h>
%End
/** \brief Coordinate (in output device coordinate system) of top left corner
/** \brief Coordinate (in output device coordinate system) of top left corner
* of the part of the raster that is to be rendered.*/
QgsPoint mTopLeftPoint;
/** \brief Coordinate (in output device coordinate system) of bottom right corner
/** \brief Coordinate (in output device coordinate system) of bottom right corner
* of the part of the raster that is to be rendered.*/
QgsPoint mBottomRightPoint;

/** \brief Width, number of columns to be rendered */
int mWidth;
/** \brief Distance in map units from bottom edge to top edge for the part of
/** \brief Distance in map units from bottom edge to top edge for the part of
* the raster that is to be rendered.*/
/** \brief Height, number of rows to be rendered */
int mHeight;
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmaptool.sip
Expand Up @@ -84,7 +84,7 @@ class QgsMapTool : QObject
QAbstractButton* button();

/** Set a user defined cursor */
virtual void setCursor(QCursor cursor);
virtual void setCursor(QCursor cursor);

/** Check whether this MapTool performs a zoom or pan operation.
* If it does, we will be able to perform the zoom and then
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmessagebar.sip
Expand Up @@ -43,7 +43,7 @@ class QgsMessageBar: QFrame
static QgsMessageBarItem* createMessage( const QString &title, const QString &text, QWidget *parent = 0 ) /Factory/;
//! make out a widget containing title and message to be displayed on the bar
static QgsMessageBarItem* createMessage( QWidget *widget, QWidget *parent = 0 ) /Factory/;

//! convenience method for pushing a non-widget-based message to the bar
void pushMessage( const QString &text, MessageLevel level = INFO, int duration = 0 );
//! convenience method for pushing a non-widget-based message with title to the bar
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmessagebaritem.sip
Expand Up @@ -32,7 +32,7 @@ class QgsMessageBarItem: QWidget

//! returns the duration in second of the message
int duration();

//! returns the level
QgsMessageBar::MessageLevel level();

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -569,7 +569,7 @@ def convex_hull(self, useField ):
hull = []
fitA = vproviderA.getFeatures()
while fitA.nextFeature( inFeat ):
idVar = inFeat.attribute( importedFieldName )
idVar = inFeat.attribute( importedFieldName )
if idVar == i:
if first:
firstFeature = QgsFeature( inFeat )
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/ProcessingPlugin.py
Expand Up @@ -48,8 +48,8 @@
class ProcessingPlugin:

def __init__(self, iface):
interface.iface = iface
Processing.initialize()
interface.iface = iface
Processing.initialize()

def initGui(self):
self.commander = None
Expand Down
18 changes: 9 additions & 9 deletions python/plugins/processing/algs/SaveSelectedFeatures.py
Expand Up @@ -53,7 +53,7 @@ def defineCharacteristics(self):
'''Here we define the inputs and output of the algorithm, along
with some other properties.
This will give the algorithm its semantics, and allow to use it in the modeler.
As a rule of thumb, do not produce anything not declared here.
As a rule of thumb, do not produce anything not declared here.
It will work fine in the toolbox, but it will not work in the modeler.
If that's what you intend, then set self.showInModeler = False'''

Expand All @@ -74,14 +74,14 @@ def processAlgorithm(self, progress):
'''Here is where the processing itself takes place'''

#the first thing to do is retrieve the values of the parameters
#entered by the user.
#entered by the user.
#The getParameterValue will return the value with its corresponding type,
#strings in the case of inputs and outputs
inputFilename = self.getParameterValue(self.INPUT_LAYER)

#The output. It will get the value of the destinatation file entered by the user.
#If the user select "Save to temporary file", when we arrive here it will already have an asigned value,
#which will be a temporary file using the first supported file format of the corresponding algorithm provider
#If the user select "Save to temporary file", when we arrive here it will already have an asigned value,
#which will be a temporary file using the first supported file format of the corresponding algorithm provider
output = self.getOutputFromName(self.OUTPUT_LAYER)

#input layers values are always a string with its location.
Expand All @@ -98,13 +98,13 @@ def processAlgorithm(self, progress):
#If the selected format is not supported, the first available format from
#the provider is used, and the corresponding file extension appended
provider = vectorLayer.dataProvider()
writer = output.getVectorWriter( provider.fields(),
provider.geometryType(),
#this is the layer crs. By default all resulting layers are
writer = output.getVectorWriter( provider.fields(),
provider.geometryType(),
#this is the layer crs. By default all resulting layers are
#assumed to be in the same crs are the inputs, and will be loaded
#with this assumptions when executed from the toolbox.
#The self.crs variable has to be canged in case this is not true,
#or in case there are no input layer from which the output crs can be infered
#or in case there are no input layer from which the output crs can be infered
vectorLayer.crs() )

#Now we take the selected features and add them to the output layer
Expand Down
16 changes: 8 additions & 8 deletions python/plugins/processing/algs/ftools/Buffer.py
Expand Up @@ -54,21 +54,21 @@ def buffering(progress, writer, distance, field, useField, layer, dissolve, segm
else:
value = distance

inGeom = QgsGeometry(inFeat.geometry())
inGeom = QgsGeometry(inFeat.geometry())
outGeom = inGeom.buffer(float(value), segments)
if first:
tempGeom = QgsGeometry(outGeom)
first = False
else:
tempGeom = tempGeom.combine(outGeom)
else:
tempGeom = tempGeom.combine(outGeom)

current += 1
progress.setPercentage(int(current * total))

outFeat.setGeometry(tempGeom)
outFeat.setAttributes(attrs)
writer.addFeature(outFeat)

# without dissolve
else:
for inFeat in features:
Expand All @@ -77,11 +77,11 @@ def buffering(progress, writer, distance, field, useField, layer, dissolve, segm
value = attrs[field]
else:
value = distance
inGeom = QgsGeometry(inFeat.geometry())
outGeom = inGeom.buffer(float(value), segments)
inGeom = QgsGeometry(inFeat.geometry())
outGeom = inGeom.buffer(float(value), segments)
outFeat.setGeometry(outGeom)
outFeat.setAttributes(attrs)
writer.addFeature(outFeat)
writer.addFeature(outFeat)
current += 1
progress.setPercentage(int(current * total))

Expand Down
8 changes: 4 additions & 4 deletions python/plugins/processing/core/GeoAlgorithm.py
Expand Up @@ -65,9 +65,9 @@ def __init__(self):
self.canRunInBatchMode = True
#to be set by the provider when it loads the algorithm
self.provider = None
#if the algorithm is run as part of a model, the parent model can be set in this variable,
#to allow for customized behaviour, in case some operations should be run differently when

#if the algorithm is run as part of a model, the parent model can be set in this variable,
#to allow for customized behaviour, in case some operations should be run differently when
#running as part of a model
self.model = None

Expand Down Expand Up @@ -141,7 +141,7 @@ def checkParameterValuesBeforeExecuting(self):


def execute(self, progress, model = None):

'''The method to use to call a processing algorithm.
Although the body of the algorithm is in processAlgorithm(),
it should be called using this method, since it performs
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/core/ProcessingConfig.py
Expand Up @@ -54,7 +54,7 @@ def initialize():
ProcessingConfig.settingIcons["General"] = icon
ProcessingConfig.addSetting(Setting("General", ProcessingConfig.SHOW_DEBUG_IN_DIALOG, "Show extra info in Log panel", True))
ProcessingConfig.addSetting(Setting("General", ProcessingConfig.KEEP_DIALOG_OPEN, "Keep dialog open after running an algorithm", False))
ProcessingConfig.addSetting(Setting("General", ProcessingConfig.USE_SELECTED, "Use only selected features", True))
ProcessingConfig.addSetting(Setting("General", ProcessingConfig.USE_SELECTED, "Use only selected features", True))
ProcessingConfig.addSetting(Setting("General", ProcessingConfig.USE_FILENAME_AS_LAYER_NAME, "Use filename as layer name", False))
ProcessingConfig.addSetting(Setting("General", ProcessingConfig.SHOW_RECENT_ALGORITHMS, "Show recently executed algorithms", True))
ProcessingConfig.addSetting(Setting("General", ProcessingConfig.OUTPUT_FOLDER, "Output folder", tempFolder()))
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/grass/GrassAlgorithm.py
Expand Up @@ -405,7 +405,7 @@ def exportVectorLayer(self, orgFilename):
return command

def setSessionProjectionFromProject(self, commands):
if not GrassUtils.projectionSet:
if not GrassUtils.projectionSet:
proj4 = interface.iface.mapCanvas().mapRenderer().destinationCrs().toProj4()
command = "g.proj"
command +=" -c"
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/grass/GrassUtils.py
Expand Up @@ -67,12 +67,12 @@ def grassScriptFilename():
filename = "grass_script.bat"
filename = userFolder() + os.sep + filename
return filename

@staticmethod
def getGrassVersion():
#I do not know if this should be removed or let the user enter it
#or something like that... This is just a temporary thing
return "6.4.0"
return "6.4.0"

@staticmethod
def grassPath():
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/gui/AlgorithmExecutionDialog.py
Expand Up @@ -73,7 +73,7 @@ def __init__(self, alg, mainWidget):
self.runButton = QtGui.QPushButton()
self.runButton.setText("Run")
self.buttonBox.addButton(self.runButton, QtGui.QDialogButtonBox.ActionRole)
self.runButton.clicked.connect(self.accept)
self.runButton.clicked.connect(self.accept)
self.setWindowTitle(self.alg.name)
self.progressLabel = QtGui.QLabel()
self.progress = QtGui.QProgressBar()
Expand Down Expand Up @@ -185,7 +185,7 @@ def setParamValue(self, param, widget):
@pyqtSlot()
def accept(self):
checkCRS = ProcessingConfig.getSetting(ProcessingConfig.WARN_UNMATCHING_CRS)
keepOpen = ProcessingConfig.getSetting(ProcessingConfig.KEEP_DIALOG_OPEN)
keepOpen = ProcessingConfig.getSetting(ProcessingConfig.KEEP_DIALOG_OPEN)
self.showDebug = ProcessingConfig.getSetting(ProcessingConfig.SHOW_DEBUG_IN_DIALOG)
try:
self.setParamValues()
Expand Down Expand Up @@ -216,7 +216,7 @@ def accept(self):
self.progress.setMaximum(0)
self.progressLabel.setText("Processing algorithm...")
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))

self.setInfo("<b>Algorithm %s starting...</b>" % self.alg.name)
if self.iterateParam:
if UnthreadedAlgorithmExecutor.runalgIterating(self.alg, self.iterateParam, self):
Expand All @@ -238,7 +238,7 @@ def accept(self):
if not keepOpen:
self.close()
else:
self.resetGUI()
self.resetGUI()
except AlgorithmExecutionDialog.InvalidParameterValue as ex:
try:
self.buttonBox.accepted.connect(lambda: ex.widget.setPalette(QPalette()))
Expand Down Expand Up @@ -295,7 +295,7 @@ def cancel(self):
def resetGUI(self):
QApplication.restoreOverrideCursor()
self.progressLabel.setText("")
self.progress.setValue(0)
self.progress.setValue(0)
self.runButton.setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(False)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/gui/BatchProcessingDialog.py
Expand Up @@ -174,13 +174,13 @@ def accept(self):

QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
self.table.setEnabled(False)
self.tabWidget.setCurrentIndex(1)
self.tabWidget.setCurrentIndex(1)
self.progress.setMaximum(len(self.algs))
for i, alg in enumerate(self.algs):
self.setBaseText("Processing algorithm " + str(i+1) + "/" + str(len(self.algs)) + "...")
if UnthreadedAlgorithmExecutor.runalg(alg, self) and not self.canceled:
if self.load[i]:
Postprocessing.handleAlgorithmResults(alg, self, False)
Postprocessing.handleAlgorithmResults(alg, self, False)
else:
QApplication.restoreOverrideCursor()
return
Expand Down

0 comments on commit 51297d5

Please sign in to comment.