本文整理汇总了Python中SagaUtils.sagaDescriptionPath方法的典型用法代码示例。如果您正苦于以下问题:Python SagaUtils.sagaDescriptionPath方法的具体用法?Python SagaUtils.sagaDescriptionPath怎么用?Python SagaUtils.sagaDescriptionPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SagaUtils
的用法示例。
在下文中一共展示了SagaUtils.sagaDescriptionPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _loadAlgorithms
# 需要导入模块: import SagaUtils [as 别名]
# 或者: from SagaUtils import sagaDescriptionPath [as 别名]
def _loadAlgorithms(self):
self.algs = []
version = SagaUtils.getSagaInstalledVersion(True)
if version is None:
ProcessingLog.addToLog(
ProcessingLog.LOG_ERROR,
self.tr("Problem with SAGA installation: SAGA was not found or is not correctly installed"),
)
return
if version not in self.supportedVersions:
lastVersion = sorted(self.supportedVersions.keys())[-1]
if version > lastVersion:
version = lastVersion
else:
ProcessingLog.addToLog(
ProcessingLog.LOG_ERROR,
self.tr("Problem with SAGA installation: installed SAGA version (%s) is not supported" % version),
)
return
folder = SagaUtils.sagaDescriptionPath()
folder = os.path.join(folder, self.supportedVersions[version][0])
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith("txt"):
f = os.path.join(folder, descriptionFile)
self._loadAlgorithm(f, version)
self.algs.append(SplitRGBBands())
示例2: _loadAlgorithms
# 需要导入模块: import SagaUtils [as 别名]
# 或者: from SagaUtils import sagaDescriptionPath [as 别名]
def _loadAlgorithms(self):
self.algs = []
version = SagaUtils.getSagaInstalledVersion(True)
if version is None:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr('Problem with SAGA installation: SAGA was not found or is not correctly installed'))
return
if version not in self.supportedVersions:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr('Problem with SAGA installation: installed SAGA version (%s) is not supported' % version))
return
folder = SagaUtils.sagaDescriptionPath()
folder = os.path.join(folder, self.supportedVersions[SagaUtils.getSagaInstalledVersion()][0])
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith('txt'):
f = os.path.join(folder, descriptionFile)
self._loadAlgorithm(f)
self.algs.append(SplitRGBBands())