Skip to content
Permalink
Browse files

improvement in saga and grass algorithms loading

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@256 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf
volayaf committed Jun 19, 2012
1 parent e0b6ab5 commit ef82ced782ea4a5a482a5e2effc717b4030ceb3a
Showing with 17 additions and 13 deletions.
  1. +8 −7 src/sextante/grass/GrassAlgorithmProvider.py
  2. +9 −6 src/sextante/saga/SagaAlgorithmProvider.py
@@ -49,14 +49,15 @@ def createAlgsList(self):
self.preloadedAlgs = []
folder = GrassUtils.grassDescriptionPath()
for descriptionFile in os.listdir(folder):
try:
alg = GrassAlgorithm(os.path.join(folder, descriptionFile))
if alg.name.strip() != "":
self.preloadedAlgs.append(alg)
else:
if descriptionFile.endswith("txt"):
try:
alg = GrassAlgorithm(os.path.join(folder, descriptionFile))
if alg.name.strip() != "":
self.preloadedAlgs.append(alg)
else:
SextanteLog.addToLog(SextanteLog.LOG_ERROR, "Could not open GRASS algorithm: " + descriptionFile)
except Exception,e:
SextanteLog.addToLog(SextanteLog.LOG_ERROR, "Could not open GRASS algorithm: " + descriptionFile)
except Exception:
SextanteLog.addToLog(SextanteLog.LOG_ERROR, "Could not open GRASS algorithm: " + descriptionFile)
#self.preloadedAlgs.append(nviz())
#self.createDescriptionFiles()

@@ -42,12 +42,15 @@ def createAlgsList(self):
self.preloadedAlgs = []
folder = SagaUtils.sagaDescriptionPath()
for descriptionFile in os.listdir(folder):
try:
alg = SagaAlgorithm(os.path.join(folder, descriptionFile))
if alg.name.strip() != "":
self.preloadedAlgs.append(alg)
except Exception:
SextanteLog.addToLog(SextanteLog.LOG_ERROR, "Could not open SAGA algorithm: " + descriptionFile)
if descriptionFile.endswith("txt"):
try:
alg = SagaAlgorithm(os.path.join(folder, descriptionFile))
if alg.name.strip() != "":
self.preloadedAlgs.append(alg)
else:
SextanteLog.addToLog(SextanteLog.LOG_ERROR, "Could not open SAGA algorithm: " + descriptionFile)
except Exception,e:
SextanteLog.addToLog(SextanteLog.LOG_ERROR, "Could not open SAGA algorithm: " + descriptionFile)

def _loadAlgorithms(self):
self.algs = self.preloadedAlgs

0 comments on commit ef82ced

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