Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 committed Jul 10, 2012
1 parent f969579 commit 0b8e107
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sextante/core/Sextante.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0b8e107

Please sign in to comment.