class Param(Element):
- def __init__(self, block, n, types):
+ def __init__(self, block, n):
"""
Make a new param from nested data.
@param block the parent element
@param n the nested odict
- @param types a list of possible types
"""
- self._types = types
#grab the data
self._name = n.find('name')
self._key = n.find('key')
The value must be evaluated and type must a possible type.
"""
Element.validate(self)
- try: assert self.get_type() in self._types
+ try: assert self.get_type() in self.get_types()
except AssertionError: self.add_error_message('Type "%s" is not a possible type.'%self.get_type())
def get_evaluated(self): raise NotImplementedError
"""
raise NotImplementedError
+ def get_types(self):
+ """
+ Get a list of all possible param types.
+ @throw NotImplementedError
+ """
+ raise NotImplementedError
+
def get_color(self): return '#FFFFFF'
def __str__(self): return 'Param - %s(%s)'%(self.get_name(), self.get_key())
def is_param(self): return True