Skip to content

Commit 2ad27b1

Browse files
arnaud-morvanvolaya
authored andcommitted
Add metadata property to parameters
1 parent 484fd18 commit 2ad27b1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

python/plugins/processing/core/parameters.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ class Parameter(object):
5858
take as input.
5959
"""
6060

61-
def __init__(self, name='', description='', default=None, optional=False):
61+
default_metadata = {}
62+
63+
def __init__(self, name='', description='', default=None, optional=False,
64+
metadata={}):
6265
self.name = name
6366
self.description = description
6467
self.default = default
@@ -73,6 +76,10 @@ def __init__(self, name='', description='', default=None, optional=False):
7376

7477
self.optional = parseBool(optional)
7578

79+
# TODO: make deep copy and deep update
80+
self.metadata = self.default_metadata.copy()
81+
self.metadata.update(metadata)
82+
7683
def setValue(self, obj):
7784
"""
7885
Sets the value of the parameter.

0 commit comments

Comments
 (0)