Skip to content

Commit

Permalink
[processing][needs-docs] Add missing input and output types to decora…
Browse files Browse the repository at this point in the history
…tor syntax
  • Loading branch information
nyalldawson committed Aug 6, 2019
1 parent 35fc379 commit 6a4ec5b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion python/processing/algfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@
QgsProcessingParameterRasterLayer,
QgsProcessingParameterVectorLayer,
QgsProcessingParameterMeshLayer,
QgsProcessingParameterColor,
QgsProcessingParameterScale,
QgsProcessingParameterLayout,
QgsProcessingParameterLayoutItem,
QgsProcessingOutputString,
QgsProcessingOutputBoolean,
QgsProcessingOutputFile,
QgsProcessingOutputFolder,
QgsProcessingOutputHtml,
Expand Down Expand Up @@ -316,6 +321,10 @@ class ProcessingAlgFactory():
POINT = "POINT",
RANGE = "RANGE",
AUTH_CFG = "AUTH_CFG"
SCALE = "SCALE"
COLOR = "COLOR"
LAYOUT = "LAYOUT"
LAYOUT_ITEM = "LAYOUT_ITEM"

def __init__(self):
self._current = None
Expand Down Expand Up @@ -378,6 +387,7 @@ def output(self, type, *args, **kwargs):
alg.MULTILAYER: QgsProcessingOutputMultipleLayers
alg.RASTER_LAYER: QgsProcessingOutputRasterLayer
alg.VECTOR_LAYER: QgsProcessingOutputVectorLayer
alg.BOOL: QgsProcessingOutputBoolean
:param type: The type of the input. This should be a type define on `alg` like alg.STRING, alg.DISTANCE
:keyword label: The label of the output. Will convert into `description` arg.
Expand Down Expand Up @@ -443,7 +453,10 @@ def input(self, type, *args, **kwargs):
alg.VECTOR_LAYER: QgsProcessingParameterVectorLayer
alg.AUTH_CFG: QgsProcessingParameterAuthConfig
alg.MESH_LAYER: QgsProcessingParameterMeshLayer
alg.SCALE: QgsProcessingParameterScale
alg.LAYOUT: QgsProcessingParameterLayout
alg.LAYOUT_ITEM: QgsProcessingParameterLayoutItem
alg.COLOR: QgsProcessingParameterColor
:param type: The type of the input. This should be a type define on `alg` like alg.STRING, alg.DISTANCE
:keyword label: The label of the output. Translates into `description` arg.
Expand Down Expand Up @@ -491,6 +504,10 @@ def dec(f):
ProcessingAlgFactory.VECTOR_LAYER: QgsProcessingParameterVectorLayer,
ProcessingAlgFactory.AUTH_CFG: QgsProcessingParameterAuthConfig,
ProcessingAlgFactory.MESH_LAYER: QgsProcessingParameterMeshLayer,
ProcessingAlgFactory.SCALE: QgsProcessingParameterScale,
ProcessingAlgFactory.LAYOUT: QgsProcessingParameterLayout,
ProcessingAlgFactory.LAYOUT_ITEM: QgsProcessingParameterLayoutItem,
ProcessingAlgFactory.COLOR: QgsProcessingParameterColor,
}

output_type_mapping = {
Expand All @@ -509,4 +526,5 @@ def dec(f):
ProcessingAlgFactory.MULTILAYER: partial(_make_output, cls=QgsProcessingOutputMultipleLayers),
ProcessingAlgFactory.RASTER_LAYER: partial(_make_output, cls=QgsProcessingOutputRasterLayer),
ProcessingAlgFactory.VECTOR_LAYER: partial(_make_output, cls=QgsProcessingOutputVectorLayer),
ProcessingAlgFactory.BOOL: partial(_make_output, cls=QgsProcessingOutputBoolean),
}

0 comments on commit 6a4ec5b

Please sign in to comment.