예제 #1
0
 def _loadAlgorithms(self):
     self.algs = []
     folder = SagaUtils.sagaDescriptionPath()
     for descriptionFile in os.listdir(folder):
         if descriptionFile.endswith('txt'):
             if not SagaUtils.isSaga208():
                 if descriptionFile.startswith('2.0.8'):
                     continue
             else:
                 if descriptionFile.startswith('2.1'):
                     continue
             try:
                 alg = SagaAlgorithm(os.path.join(folder, descriptionFile))
                 if alg.name.strip() != '':
                     self.algs.append(alg)
                 else:
                     ProcessingLog.addToLog(
                         ProcessingLog.LOG_ERROR,
                         'Could not open SAGA algorithm: ' +
                         descriptionFile)
             except Exception, e:
                 ProcessingLog.addToLog(
                     ProcessingLog.LOG_ERROR,
                     'Could not open SAGA algorithm: ' + descriptionFile +
                     '\n' + str(e))
예제 #2
0
 def _loadAlgorithms(self):
     self.algs = []
     folder = SagaUtils.sagaDescriptionPath()
     for descriptionFile in os.listdir(folder):
         if descriptionFile.endswith('txt'):
             if not SagaUtils.isSaga208():
                 if descriptionFile.startswith('2.0.8'):
                     continue
             else:
                 if descriptionFile.startswith('2.1'):
                     continue
             try:
                 alg = SagaAlgorithm(os.path.join(folder, descriptionFile))
                 if alg.name.strip() != '':
                     self.algs.append(alg)
                 else:
                     ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
                             'Could not open SAGA algorithm: '
                             + descriptionFile)
             except Exception, e:
                 ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
                         'Could not open SAGA algorithm: '
                         + descriptionFile + '\n' + str(e))
예제 #3
0
 def _loadAlgorithms(self):
     self.algs = []
     saga208 = ProcessingConfig.getSetting(SagaUtils.SAGA_208)
     folder = SagaUtils.sagaDescriptionPath()
     for descriptionFile in os.listdir(folder):
         if descriptionFile.endswith("txt"):
             if not saga208:
                 if descriptionFile.startswith("2.0.8"):
                     continue
             else:
                 if descriptionFile.startswith("2.1"):
                     continue
             try:
                 alg = SagaAlgorithm(os.path.join(folder, descriptionFile))
                 if alg.name.strip() != "":
                     self.algs.append(alg)
                 else:
                     ProcessingLog.addToLog(
                         ProcessingLog.LOG_ERROR, "Could not open SAGA algorithm: " + descriptionFile
                     )
             except Exception, e:
                 ProcessingLog.addToLog(
                     ProcessingLog.LOG_ERROR, "Could not open SAGA algorithm: " + descriptionFile + "\n" + str(e)
                 )