Skip to content
Permalink
Browse files

indentation update (note to self: always run scripts/prepare-commit.s…

…h before committing)
  • Loading branch information
jef-n committed Sep 17, 2013
1 parent 58d0483 commit 51297d59909c69caa1f54cfcd937ce0666834549
Showing with 450 additions and 436 deletions.
  1. +8 −8 python/core/composer/qgscomposermap.sip
  2. +4 −5 python/core/composer/qgscomposershape.sip
  3. +1 −1 python/core/qgsattributeaction.sip
  4. +1 −1 python/core/qgsgmlschema.sip
  5. +1 −1 python/core/raster/qgsrasterdataprovider.sip
  6. +5 −5 python/core/raster/qgsrasterrange.sip
  7. +3 −3 python/core/raster/qgsrasterviewport.sip
  8. +1 −1 python/gui/qgsmaptool.sip
  9. +1 −1 python/gui/qgsmessagebar.sip
  10. +1 −1 python/gui/qgsmessagebaritem.sip
  11. +1 −1 python/plugins/fTools/tools/doGeoprocessing.py
  12. +2 −2 python/plugins/processing/ProcessingPlugin.py
  13. +9 −9 python/plugins/processing/algs/SaveSelectedFeatures.py
  14. +8 −8 python/plugins/processing/algs/ftools/Buffer.py
  15. +4 −4 python/plugins/processing/core/GeoAlgorithm.py
  16. +1 −1 python/plugins/processing/core/ProcessingConfig.py
  17. +1 −1 python/plugins/processing/grass/GrassAlgorithm.py
  18. +2 −2 python/plugins/processing/grass/GrassUtils.py
  19. +5 −5 python/plugins/processing/gui/AlgorithmExecutionDialog.py
  20. +2 −2 python/plugins/processing/gui/BatchProcessingDialog.py
  21. +4 −5 python/plugins/processing/gui/MessageBarProgress.py
  22. +1 −1 python/plugins/processing/gui/ParametersDialog.py
  23. +3 −3 python/plugins/processing/gui/UnthreadedAlgorithmExecutor.py
  24. +1 −1 python/plugins/processing/modeler/ModelerAlgorithm.py
  25. +5 −5 python/plugins/processing/saga/SagaAlgorithm.py
  26. +1 −1 python/plugins/processing/saga/SagaUtils.py
  27. +1 −1 python/plugins/processing/tests/ProcessingToolsTest.py
  28. +1 −1 python/plugins/processing/tools/dataobjects.py
  29. +4 −4 python/plugins/processing/tools/vector.py
  30. +1 −1 python/pyspatialite/CMakeLists.txt
  31. +4 −4 src/app/pluginmanager/qgspluginitemdelegate.cpp
  32. +1 −1 src/app/pluginmanager/qgspluginitemdelegate.h
  33. +3 −3 src/app/pluginmanager/qgspluginsortfilterproxymodel.cpp
  34. +18 −18 src/app/qgisapp.cpp
  35. +1 −1 src/core/composer/qgscomposerlegenditem.h
  36. +1 −0 src/core/composer/qgscomposershape.h
  37. +3 −3 src/core/composer/qgslegendmodel.h
  38. +5 −5 src/core/qgsapplication.cpp
  39. +3 −2 src/core/qgsapplication.h
  40. +1 −1 src/core/qgsgeometry.cpp
  41. +1 −1 src/core/qgsvectorlayereditutils.cpp
  42. +6 −6 src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
  43. +19 −19 src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
  44. +1 −1 src/core/symbology-ng/qgsrendererv2.h
  45. +38 −37 src/core/symbology-ng/qgsrulebasedrendererv2.cpp
  46. +2 −2 src/core/symbology-ng/qgsrulebasedrendererv2.h
  47. +24 −24 src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp
  48. +11 −11 src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
  49. +25 −25 src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
  50. +1 −1 src/mapserver/qgshttprequesthandler.cpp
  51. +59 −46 src/mapserver/qgswmsserver.cpp
  52. +15 −15 src/mapserver/qgswmsserver.h
  53. +117 −117 src/providers/postgres/qgspostgresfeatureiterator.cpp
  54. +4 −4 src/python/qgspythonutilsimpl.cpp
  55. +3 −3 tests/src/core/testqgscomposershapes.cpp
  56. +1 −1 tests/src/python/test_qgscomposershapes.py
@@ -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*/
@@ -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*/
@@ -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 );
@@ -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 );
@@ -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
@@ -18,7 +18,7 @@ class QgsGmlFeatureClass
QStringList & geometryAttributes();
};

class QgsGmlSchema: QObject
class QgsGmlSchema: QObject
{

%TypeHeaderCode
@@ -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
@@ -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 );
@@ -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;
@@ -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
@@ -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
@@ -32,7 +32,7 @@ class QgsMessageBarItem: QWidget

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

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

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

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

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

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

0 comments on commit 51297d5

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