diff --git a/python/gui/qgsfieldcombobox.sip b/python/gui/qgsfieldcombobox.sip index a633017423e..2a0b3c90b27 100644 --- a/python/gui/qgsfieldcombobox.sip +++ b/python/gui/qgsfieldcombobox.sip @@ -32,7 +32,7 @@ class QgsFieldComboBox : QComboBox public slots: //! set the layer of which the fields are listed void setLayer( QgsVectorLayer* layer ); - + //! convenience slot to connect QgsMapLayerComboBox layer signal void setLayer( QgsMapLayer* layer ); diff --git a/python/gui/qgsfieldexpressionwidget.sip b/python/gui/qgsfieldexpressionwidget.sip index 1039e22e207..a4fe77b17a8 100644 --- a/python/gui/qgsfieldexpressionwidget.sip +++ b/python/gui/qgsfieldexpressionwidget.sip @@ -27,16 +27,16 @@ class QgsFieldExpressionWidget : QWidget QgsVectorLayer* layer(); signals: - //! the signal is emitted when the currently selected field changes - void fieldChanged( QString fieldName ); - + //! the signal is emitted when the currently selected field changes + void fieldChanged( QString fieldName ); + //! fieldChanged signal with indication of the validity of the expression void fieldChanged( QString fieldName, bool isValid ); public slots: //! set the layer used to display the fields and expression void setLayer( QgsVectorLayer* layer ); - + //! convenience slot to connect QgsMapLayerComboBox layer signal void setLayer( QgsMapLayer* layer ); diff --git a/python/gui/qgsfieldmodel.sip b/python/gui/qgsfieldmodel.sip index 9eee025435d..52aa3f4a08d 100644 --- a/python/gui/qgsfieldmodel.sip +++ b/python/gui/qgsfieldmodel.sip @@ -28,7 +28,7 @@ class QgsFieldModel : QAbstractItemModel //! return the index corresponding to a given fieldName QModelIndex indexFromName( QString fieldName ); - + //! returns the currently used layer void setAllowExpression( bool allowExpression ); bool allowExpression(); @@ -38,7 +38,7 @@ class QgsFieldModel : QAbstractItemModel * @return the model index of the newly added expression */ QModelIndex setExpression( QString expression ); - + //! remove expressions from the model void removeExpression(); @@ -48,10 +48,10 @@ class QgsFieldModel : QAbstractItemModel public slots: //! set the layer of whch fields are displayed void setLayer( QgsVectorLayer *layer ); - + protected slots: virtual void updateModel(); - + // QAbstractItemModel interface public: QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const; diff --git a/python/gui/qgsmapcanvas.sip b/python/gui/qgsmapcanvas.sip index 934514ae5b5..b2870c931d1 100644 --- a/python/gui/qgsmapcanvas.sip +++ b/python/gui/qgsmapcanvas.sip @@ -354,7 +354,7 @@ class QgsMapCanvas : QGraphicsView //! Emit map tool changed event void mapToolSet( QgsMapTool *tool ); - + //! Emit map tool changed with the old tool //! @note added in 2.3 void mapToolSet( QgsMapTool *newTool, QgsMapTool* oldTool ); diff --git a/python/gui/qgsmaptool.sip b/python/gui/qgsmaptool.sip index d19466a78a9..639910006ae 100644 --- a/python/gui/qgsmaptool.sip +++ b/python/gui/qgsmaptool.sip @@ -105,7 +105,7 @@ class QgsMapTool : QObject //! returns pointer to the tool's map canvas QgsMapCanvas* canvas(); - + /** return the tool name * @note added in 2.3 */ diff --git a/python/plugins/processing/core/ProcessingConfig.py b/python/plugins/processing/core/ProcessingConfig.py index 7f68f9045d6..be9e79a5678 100644 --- a/python/plugins/processing/core/ProcessingConfig.py +++ b/python/plugins/processing/core/ProcessingConfig.py @@ -142,10 +142,10 @@ class ProcessingConfig: @staticmethod - def readSettings(): + def readSettings(): for setting in ProcessingConfig.settings.values(): setting.read() - + @staticmethod def getSetting(name): @@ -177,15 +177,15 @@ class Setting: self.value = default self.hidden = hidden self.valuetype = valuetype - + def read(self): - qsettings = QSettings() + qsettings = QSettings() value = qsettings.value(self.qname, None) if value is not None: if isinstance(self.value, bool): value = str(value).lower() == str(True).lower() self.value = value - + def save(self): QSettings().setValue(self.qname, self.value) diff --git a/python/plugins/processing/gui/ScriptEditorDialog.py b/python/plugins/processing/gui/ScriptEditorDialog.py index bbee64e590f..33b842bd364 100644 --- a/python/plugins/processing/gui/ScriptEditorDialog.py +++ b/python/plugins/processing/gui/ScriptEditorDialog.py @@ -52,7 +52,7 @@ class ScriptEditorDialog(QDialog, Ui_DlgScriptEditor): SCRIPT_PYTHON = 0 SCRIPT_R = 1 - + hasChanged = False def __init__(self, algType, alg): @@ -101,7 +101,7 @@ class ScriptEditorDialog(QDialog, Ui_DlgScriptEditor): self.update = False self.help = None - + self.setHasChanged(False) self.editor.setLexerType(self.algType) @@ -177,7 +177,7 @@ class ScriptEditorDialog(QDialog, Ui_DlgScriptEditor): def setHasChanged(self, hasChanged): self.hasChanged = hasChanged self.btnSave.setEnabled(hasChanged) - + def runAlgorithm(self): if self.algType == self.SCRIPT_PYTHON: alg = ScriptAlgorithm(None, unicode(self.editor.text())) diff --git a/python/plugins/processing/modeler/AddModelFromFileAction.py b/python/plugins/processing/modeler/AddModelFromFileAction.py index 7a41798f19e..aad8e990438 100644 --- a/python/plugins/processing/modeler/AddModelFromFileAction.py +++ b/python/plugins/processing/modeler/AddModelFromFileAction.py @@ -41,7 +41,7 @@ class AddModelFromFileAction(ToolboxAction): def getIcon(self): return QtGui.QIcon(os.path.dirname(__file__) + '/../images/model.png') - + def execute(self): filename = QtGui.QFileDialog.getOpenFileName(self.toolbox, 'model files', None, '*.model') diff --git a/python/plugins/processing/script/AddScriptFromFileAction.py b/python/plugins/processing/script/AddScriptFromFileAction.py index a7d1a25fa59..6a99d6ee0c8 100644 --- a/python/plugins/processing/script/AddScriptFromFileAction.py +++ b/python/plugins/processing/script/AddScriptFromFileAction.py @@ -40,7 +40,7 @@ class AddScriptFromFileAction(ToolboxAction): def getIcon(self): return QtGui.QIcon(':/processing/images/script.png') - + def execute(self): filename = QtGui.QFileDialog.getOpenFileName(self.toolbox, 'Script files', None, '*.py') diff --git a/python/plugins/processing/script/scripts/Chainage.py b/python/plugins/processing/script/scripts/Chainage.py index 962fcfb4c7c..eee146a4aa2 100644 --- a/python/plugins/processing/script/scripts/Chainage.py +++ b/python/plugins/processing/script/scripts/Chainage.py @@ -10,24 +10,24 @@ from PyQt4.QtCore import * from processing.core.VectorWriter import VectorWriter -def create_points(feat): - geom = feat.geometry() +def create_points(feat): + geom = feat.geometry() length = geom.length() currentdistance = 0 if endpoint > 0: length = endpoint - + out = QgsFeature() - while startpoint + currentdistance <= length: - point = geom.interpolate(startpoint + currentdistance) + while startpoint + currentdistance <= length: + point = geom.interpolate(startpoint + currentdistance) currentdistance = currentdistance + distance - out.setGeometry(point) - attrs = feat.attributes() - attrs.append(currentdistance) + out.setGeometry(point) + attrs = feat.attributes() + attrs.append(currentdistance) out.setAttributes(attrs) - writer.addFeature(out) + writer.addFeature(out) layer = processing.getObject(lines) @@ -39,7 +39,7 @@ writer = VectorWriter(output, None, fields, QGis.WKBPoint, feats = processing.features(layer) nFeat = len(feats) for i, feat in enumerate(feats): - progress.setPercentage(int(100 * i / nFeat)) + progress.setPercentage(int(100 * i / nFeat)) create_points(feat) del writer diff --git a/python/plugins/processing/script/scripts/Unique_values_count.py b/python/plugins/processing/script/scripts/Unique_values_count.py index ea46d1228c8..bf466803ca3 100644 --- a/python/plugins/processing/script/scripts/Unique_values_count.py +++ b/python/plugins/processing/script/scripts/Unique_values_count.py @@ -28,7 +28,7 @@ for i in xrange(1, bands + 1): # create dictionary for unique values count count = {} - + # count unique values for the given band for col in range( xsize ): for row in range( ysize ): @@ -37,7 +37,7 @@ for i in xrange(1, bands + 1): # check if cell_value is NaN if math.isnan(cell_value): cell_value = 'Null' - + # round floats if needed elif round_values_to_ndigits: try: @@ -51,12 +51,11 @@ for i in xrange(1, bands + 1): except: count[cell_value] = 1 - # print results sorted by cell_value + # print results sorted by cell_value for key in sorted(count.iterkeys()): line = "