本文整理汇总了Python中processing.core.parameters.ParameterMultipleInput.getAsString方法的典型用法代码示例。如果您正苦于以下问题:Python ParameterMultipleInput.getAsString方法的具体用法?Python ParameterMultipleInput.getAsString怎么用?Python ParameterMultipleInput.getAsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.core.parameters.ParameterMultipleInput
的用法示例。
在下文中一共展示了ParameterMultipleInput.getAsString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testGetAsStringWhenRaster
# 需要导入模块: from processing.core.parameters import ParameterMultipleInput [as 别名]
# 或者: from processing.core.parameters.ParameterMultipleInput import getAsString [as 别名]
def testGetAsStringWhenRaster(self):
parameter = ParameterMultipleInput('myName', 'myDesc', datatype=dataobjects.TYPE_RASTER)
# With Path
self.assertEqual(parameter.getAsString('/some/path'), '/some/path')
# With Layer
layer = QgsRasterLayer('/path/to/myRaster.tif', 'myRaster')
self.assertEqual(parameter.getAsString(layer), '/path/to/myRaster.tif')
示例2: testGetAsStringWhenVector
# 需要导入模块: from processing.core.parameters import ParameterMultipleInput [as 别名]
# 或者: from processing.core.parameters.ParameterMultipleInput import getAsString [as 别名]
def testGetAsStringWhenVector(self):
parameter = ParameterMultipleInput('myName', 'myDesc', datatype=dataobjects.TYPE_VECTOR_ANY)
# With Path
self.assertEqual(parameter.getAsString('/some/path'), '/some/path')
# With Layer
layer = QgsVectorLayer('/path/to/myVector.shp', 'myVector', 'memory')
self.assertEqual(parameter.getAsString(layer), '/path/to/myVector.shp')
示例3: testGetAsStringWhenVector
# 需要导入模块: from processing.core.parameters import ParameterMultipleInput [as 别名]
# 或者: from processing.core.parameters.ParameterMultipleInput import getAsString [as 别名]
def testGetAsStringWhenVector(self):
parameter = ParameterMultipleInput("myName", "myDesc", datatype=ParameterMultipleInput.TYPE_VECTOR_ANY)
# With Path
self.assertEqual(parameter.getAsString("/some/path"), "/some/path")
# With Layer
layer = QgsVectorLayer("/path/to/myVector.shp", "myVector", "memory")
self.assertEqual(parameter.getAsString(layer), "/path/to/myVector.shp")
示例4: testGetAsStringWhenRaster
# 需要导入模块: from processing.core.parameters import ParameterMultipleInput [as 别名]
# 或者: from processing.core.parameters.ParameterMultipleInput import getAsString [as 别名]
def testGetAsStringWhenRaster(self):
parameter = ParameterMultipleInput("myName", "myDesc", datatype=ParameterMultipleInput.TYPE_RASTER)
# With Path
self.assertEqual(parameter.getAsString("/some/path"), "/some/path")
# With Layer
layer = QgsRasterLayer("/path/to/myRaster.tif", "myRaster")
self.assertEqual(parameter.getAsString(layer), "/path/to/myRaster.tif")
示例5: testGetAsStringWhenFile
# 需要导入模块: from processing.core.parameters import ParameterMultipleInput [as 别名]
# 或者: from processing.core.parameters.ParameterMultipleInput import getAsString [as 别名]
def testGetAsStringWhenFile(self):
parameter = ParameterMultipleInput('myName', 'myDesc', datatype=dataobjects.TYPE_FILE)
self.assertEqual(parameter.getAsString('/some/path'), '/some/path')
示例6: testGetAsStringWhenFile
# 需要导入模块: from processing.core.parameters import ParameterMultipleInput [as 别名]
# 或者: from processing.core.parameters.ParameterMultipleInput import getAsString [as 别名]
def testGetAsStringWhenFile(self):
parameter = ParameterMultipleInput("myName", "myDesc", datatype=ParameterMultipleInput.TYPE_FILE)
self.assertEqual(parameter.getAsString("/some/path"), "/some/path")