Skip to content

Commit

Permalink
[sextante] more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Mar 27, 2013
1 parent 91fa062 commit 72037dc
Show file tree
Hide file tree
Showing 6 changed files with 363 additions and 75 deletions.
10 changes: 5 additions & 5 deletions python/plugins/sextante/algs/AutoincrementalField.py
Expand Up @@ -45,7 +45,7 @@ def processAlgorithm(self, progress):
vlayer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
vprovider = vlayer.dataProvider()
fields = vprovider.fields()
fields[len(fields)] = QgsField("AUTO", QVariant.Int)
fields.append(QgsField("AUTO", QVariant.Int))
writer = output.getVectorWriter(fields, vprovider.geometryType(), vlayer.crs() )
inFeat = QgsFeature()
outFeat = QgsFeature()
Expand All @@ -58,10 +58,10 @@ def processAlgorithm(self, progress):
nElement += 1
inGeom = inFeat.geometry()
outFeat.setGeometry( inGeom )
atMap = inFeat.attributeMap()
atMap.append(QVariant(nElement))
outFeat.setAttributeMap( atMap )
writer.addFeature( outFeat )
attrs = inFeat.attributes()
attrs.append(QVariant(nElement))
outFeat.setAttributes(attrs)
writer.addFeature(outFeat)
del writer

def defineCharacteristics(self):
Expand Down
1 change: 0 additions & 1 deletion python/plugins/sextante/algs/ftools/Dissolve.py
Expand Up @@ -56,7 +56,6 @@ def processAlgorithm(self, progress):
vproviderA = vlayerA.dataProvider()
fields = vproviderA.fields()
writer = self.getOutputFromName(Dissolve.OUTPUT).getVectorWriter(fields, vproviderA.geometryType(), vproviderA.crs() )
#inFeat = QgsFeature()
outFeat = QgsFeature()
nElement = 0
nFeat = vproviderA.featureCount()
Expand Down
2 changes: 0 additions & 2 deletions python/plugins/sextante/script/ScriptAlgorithm.py
Expand Up @@ -204,12 +204,10 @@ def processAlgorithm(self, progress):
ns['progress'] = progress

for param in self.parameters:
#script += param.name + "=" + param.getValueAsCommandLineParameter() + "\n"
ns[param.name] = param.value

for out in self.outputs:
ns[out.name] = out.value
#script += out.name + "=" + out.getValueAsCommandLineParameter() + "\n"

script+=self.script
exec(script) in ns
Expand Down

0 comments on commit 72037dc

Please sign in to comment.