当前位置: 首页>>代码示例>>Python>>正文


Python SagaUtils.sagaDescriptionPath方法代码示例

本文整理汇总了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())
开发者ID:JudeHu,项目名称:QGIS,代码行数:29,代码来源:SagaAlgorithmProvider.py

示例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())
开发者ID:Ariki,项目名称:QGIS,代码行数:21,代码来源:SagaAlgorithmProvider.py


注:本文中的SagaUtils.sagaDescriptionPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。