Skip to content

Commit 0b8e107

Browse files
author
cpolymeris@gmail.com
committedJul 10, 2012
runalg accepts algorithm parameter.
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@295 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
1 parent f969579 commit 0b8e107

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/sextante/core/Sextante.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from sextante.core.QGisLayers import QGisLayers
66
from sextante.gui.AlgorithmExecutor import AlgorithmExecutor
77
from sextante.core.SextanteConfig import SextanteConfig
8+
from sextante.core.GeoAlgorithm import GeoAlgorithm
89
from sextante.core.SextanteLog import SextanteLog
910
from sextante.modeler.ModelerAlgorithmProvider import ModelerAlgorithmProvider
1011
from sextante.ftools.FToolsAlgorithmProvider import FToolsAlgorithmProvider
@@ -246,8 +247,11 @@ def alghelp(name):
246247

247248

248249
@staticmethod
249-
def runalg(name, *args):
250-
alg = Sextante.getAlgorithm(name)
250+
def runalg(algOrName, *args):
251+
if isinstance(algOrName, GeoAlgorithm):
252+
alg = algOrName
253+
else:
254+
alg = Sextante.getAlgorithm(algOrName)
251255
if alg == None:
252256
print("Error: Algorithm not found\n")
253257
return

0 commit comments

Comments
 (0)
Please sign in to comment.