Add metadata property to parameters

This commit is contained in:
arnaud.morvan@camptocamp.com 2016-08-23 10:44:57 +02:00 committed by volaya
parent 484fd18ef6
commit 2ad27b172e

View File

@ -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.