Skip to content
Permalink
Browse files

runalg accepts algorithm parameter.

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@295 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com
cpolymeris@gmail.com committed Jul 10, 2012
1 parent f969579 commit 0b8e10728de91e7bb2d2ad7d3a690b351332c9cb
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/sextante/core/Sextante.py
@@ -5,6 +5,7 @@
from sextante.core.QGisLayers import QGisLayers
from sextante.gui.AlgorithmExecutor import AlgorithmExecutor
from sextante.core.SextanteConfig import SextanteConfig
from sextante.core.GeoAlgorithm import GeoAlgorithm
from sextante.core.SextanteLog import SextanteLog
from sextante.modeler.ModelerAlgorithmProvider import ModelerAlgorithmProvider
from sextante.ftools.FToolsAlgorithmProvider import FToolsAlgorithmProvider
@@ -246,8 +247,11 @@ def alghelp(name):


@staticmethod
def runalg(name, *args):
alg = Sextante.getAlgorithm(name)
def runalg(algOrName, *args):
if isinstance(algOrName, GeoAlgorithm):
alg = algOrName
else:
alg = Sextante.getAlgorithm(algOrName)
if alg == None:
print("Error: Algorithm not found\n")
return

0 comments on commit 0b8e107

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