mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Add metadata property to parameters
This commit is contained in:
parent
484fd18ef6
commit
2ad27b172e
@ -58,7 +58,10 @@ class Parameter(object):
|
||||
take as input.
|
||||
"""
|
||||
|
||||
def __init__(self, name='', description='', default=None, optional=False):
|
||||
default_metadata = {}
|
||||
|
||||
def __init__(self, name='', description='', default=None, optional=False,
|
||||
metadata={}):
|
||||
self.name = name
|
||||
self.description = description
|
||||
self.default = default
|
||||
@ -73,6 +76,10 @@ class Parameter(object):
|
||||
|
||||
self.optional = parseBool(optional)
|
||||
|
||||
# TODO: make deep copy and deep update
|
||||
self.metadata = self.default_metadata.copy()
|
||||
self.metadata.update(metadata)
|
||||
|
||||
def setValue(self, obj):
|
||||
"""
|
||||
Sets the value of the parameter.
|
||||
|
Loading…
x
Reference in New Issue
Block a user