def getFileFilter(self):
     if self.datatype == ParameterMultipleInput.TYPE_RASTER:
         exts = QGisLayers.getSupportedOutputRasterLayerExtensions()
     else:
         exts = QGisLayers.getSupportedOutputVectorLayerExtensions()
     for i in range(len(exts)):
         exts[i] = exts[i].upper() + " files(*." + exts[i].lower() + ")"
     return ";;".join(exts)
 def getFileFilter(self):
     if self.datatype == ParameterMultipleInput.TYPE_RASTER:
         exts = QGisLayers.getSupportedOutputRasterLayerExtensions()
     else:
         exts = QGisLayers.getSupportedOutputVectorLayerExtensions()
     for i in range(len(exts)):
         exts[i] = exts[i].upper() + " files(*." + exts[i].lower() + ")"
     return ";;".join(exts)
Beispiel #3
0
 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]
Beispiel #4
0
 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]
 def getFileFilter(self):
     exts = QGisLayers.getSupportedOutputRasterLayerExtensions()
     for i in range(len(exts)):
         exts[i] = exts[i].upper() + " files(*." + exts[i].lower() + ")"
     return ";;".join(exts)
 def getFileFilter(self):
     exts = QGisLayers.getSupportedOutputRasterLayerExtensions()
     for i in range(len(exts)):
         exts[i] = exts[i].upper() + " files(*." + exts[i].lower() + ")"
     return ";;".join(exts)