本文整理汇总了Python中processing.core.QGisLayers.QGisLayers.getSupportedOutputTableExtensions方法的典型用法代码示例。如果您正苦于以下问题:Python QGisLayers.getSupportedOutputTableExtensions方法的具体用法?Python QGisLayers.getSupportedOutputTableExtensions怎么用?Python QGisLayers.getSupportedOutputTableExtensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.core.QGisLayers.QGisLayers
的用法示例。
在下文中一共展示了QGisLayers.getSupportedOutputTableExtensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkOutputFileExtensions
# 需要导入模块: from processing.core.QGisLayers import QGisLayers [as 别名]
# 或者: from processing.core.QGisLayers.QGisLayers import getSupportedOutputTableExtensions [as 别名]
def checkOutputFileExtensions(self):
'''Checks if the values of outputs are correct and have one of the supported output extensions.
If not, it adds the first one of the supported extensions, which is assumed to be the default one'''
for out in self.outputs:
if (not out.hidden) and out.value != None:
if not os.path.isabs(out.value):
continue
if isinstance(out, OutputRaster):
exts = QGisLayers.getSupportedOutputRasterLayerExtensions()
elif isinstance(out, OutputVector):
exts = QGisLayers.getSupportedOutputVectorLayerExtensions()
elif isinstance(out, OutputTable):
exts = QGisLayers.getSupportedOutputTableExtensions()
elif isinstance(out, OutputHTML):
exts =["html", "htm"]
else:
continue
idx = out.value.rfind(".")
if idx == -1:
out.value = out.value + "." + exts[0]
else:
ext = out.value[idx + 1:]
if ext not in exts:
out.value = out.value + "." + exts[0]