1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2025-11-01 03:59:02 +01:00

Added new properties and the check_options method to the DataHandler class

This commit is contained in:
Roland Haroutiounian 2017-02-02 10:51:15 +01:00 committed by prieto
commit c2f62bce50

View file

@ -30,6 +30,9 @@ class DataHandler(object):
__custom_handlers = dict()
help_text = 'Generic Field Data Handler'
display_name = "Generic Field"
options_spec = dict()
options_values = dict()
##@brief List fields that will be exposed to the construct_data_method
_construct_datas_deps = []
@ -57,6 +60,15 @@ class DataHandler(object):
del(kwargs['default'])
for argname, argval in kwargs.items():
setattr(self, argname, argval)
self.check_options()
def check_options(self):
for option_name, option_value in self.options_values.items():
self.options_values[option_name] = self.options_spec[option_name].check_value(option_value)
@property
def options(self):
return self.options_values
## Fieldtype name
@classmethod