本文整理汇总了Python中sextante.saga.SagaUtils.SagaUtils.sagaDescriptionPath方法的典型用法代码示例。如果您正苦于以下问题:Python SagaUtils.sagaDescriptionPath方法的具体用法?Python SagaUtils.sagaDescriptionPath怎么用?Python SagaUtils.sagaDescriptionPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sextante.saga.SagaUtils.SagaUtils
的用法示例。
在下文中一共展示了SagaUtils.sagaDescriptionPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createAlgsList
# 需要导入模块: from sextante.saga.SagaUtils import SagaUtils [as 别名]
# 或者: from sextante.saga.SagaUtils.SagaUtils import sagaDescriptionPath [as 别名]
def createAlgsList(self):
self.preloadedAlgs = []
folder = SagaUtils.sagaDescriptionPath()
for descriptionFile in os.listdir(folder):
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)
示例2: createAlgsList
# 需要导入模块: from sextante.saga.SagaUtils import SagaUtils [as 别名]
# 或者: from sextante.saga.SagaUtils.SagaUtils import sagaDescriptionPath [as 别名]
def createAlgsList(self):
self.preloadedAlgs = []
folder = SagaUtils.sagaDescriptionPath()
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith("txt"):
if SextanteUtils.isWindows() or SextanteUtils.isMac():
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.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 +"\n" + str(e))